<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=2703&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / sudo.log: read only file system]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=2703</link>
		<description><![CDATA[The most recent posts in sudo.log: read only file system.]]></description>
		<lastBuildDate>Wed, 06 Mar 2019 11:24:05 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: sudo.log: read only file system]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=14656#p14656</link>
			<description><![CDATA[<p>Hello:</p><div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><p>... that won&#039;t work. This is the path valid in your home only.</p></div></blockquote></div><p>I understand (from my old DOS days) the importance and need for setting the PATH variable in a script.<br />But my *.bat days are long gone and I have no bash skills worth mentioning. </p><div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><p>Starting a shell requires setting path in the shell script or to use the full path to any command.</p></div></blockquote></div><p>Undoubtedly, it is <em>best practise</em> to do so.</p><p>But this script works and has the same result whether I add the line you suggested to it or not.<br />I expect it is so because it (the needed PATH) is <em>already</em> set elsewhere:</p><div class="codebox"><pre><code>groucho@devuan:~$ printenv | grep -i path
GLADE_CATALOG_PATH=:
GLADE_MODULE_PATH=:
GLADE_PIXMAP_PATH=:
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
groucho@devuan:~$ </code></pre></div><p>In any case, I will start adding the PATH to every script I attempt to write.</p><p>Thanks for your input.</p><p>A.</p>]]></description>
			<author><![CDATA[dummy@example.com (Altoid)]]></author>
			<pubDate>Wed, 06 Mar 2019 11:24:05 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=14656#p14656</guid>
		</item>
		<item>
			<title><![CDATA[Re: sudo.log: read only file system]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=14646#p14646</link>
			<description><![CDATA[<div class="quotebox"><cite>Altoid wrote:</cite><blockquote><div><div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><p>Observation: you haven&#039;t set a path ...</p></div></blockquote></div><p>No, that&#039;s not it.<br />It seems the path is set in the environment variables. </p><div class="codebox"><pre><code>groucho@devuan:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
groucho@devuan:~$ </code></pre></div></div></blockquote></div><p>Unfortunately, that won&#039;t work. This is the path valid in your home only. Starting a shell requires setting path in the shell script or to use the full path to any command. Example from one of my scripts:</p><div class="codebox"><pre><code>#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:</code></pre></div><p>Rolf</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Tue, 05 Mar 2019 18:51:00 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=14646#p14646</guid>
		</item>
		<item>
			<title><![CDATA[Re: sudo.log: read only file system]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=14626#p14626</link>
			<description><![CDATA[<p>Hello:</p><div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><p>Observation: you haven&#039;t set a path ...</p></div></blockquote></div><p>No, that&#039;s not it.<br />It seems the path is set in the environment variables. </p><div class="codebox"><pre><code>groucho@devuan:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
groucho@devuan:~$ </code></pre></div><p>I can run the script directly from the prompt with or without sudo.<br />With sudo it executes directly (because sudoers) without, it asks me for the PW twice. </p><div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><p>... trying to write a log during shutdown might not work.</p></div></blockquote></div><p>Seems that&#039;s it.&#160; =-)</p><p>From <a href="https://it.toolbox.com/question/file-system-runs-into-read-only-mode-061114" rel="nofollow">https://it.toolbox.com/question/file-sy … ode-061114</a></p><div class="quotebox"><blockquote><div><p>The filesystem will usually go into read-only while the system is running if ...<br />... an emergency read-only remount is requested via <span class="bbc">Alt</span>+<span class="bbc">SysRq</span>+<span class="bbc">U</span>.</p></div></blockquote></div><p>So it is normal that <span class="bbc">sudo</span> cannot write to it&#039;s log file after <span class="bbc">U</span> is called.&#160; </p><p>Thanks for your input.</p><p>Best,</p><p>A.</p>]]></description>
			<author><![CDATA[dummy@example.com (Altoid)]]></author>
			<pubDate>Mon, 04 Mar 2019 19:07:01 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=14626#p14626</guid>
		</item>
		<item>
			<title><![CDATA[Re: sudo.log: read only file system]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=14619#p14619</link>
			<description><![CDATA[<p>Observation: you haven&#039;t set a path in the script. </p><p>2nd guess: trying to write a log during shutdown might not work. </p><p>Regards, Rolf</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Mon, 04 Mar 2019 17:45:01 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=14619#p14619</guid>
		</item>
		<item>
			<title><![CDATA[sudo.log: read only file system]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=14618#p14618</link>
			<description><![CDATA[<p>Hello:</p><p>In order to overcome (ie: eventually diagnose and maybe solve) a shutdown problem I have with my Sun Ultra 24 rig, I am currently shutting down with a script instead of the Xfce shutdown button (which calls the shutdown helper executable):&#160; </p><div class="codebox"><pre><code>groucho@devuan:~$ cat /usr/bin/magicdown.sh
#!/bin/sh
# Shutdown system without the use of shutdownhelper 
#
for i in s u o; do echo $i | sudo tee /proc/sysrq-trigger; sleep 6; done  # halt
groucho@devuan:~$ </code></pre></div><p>In order to make it as easy to use as possible and also see what&#039;s going on, I launch it in terminal via a *.desktop file:</p><div class="codebox"><pre><code>[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=shutdown
Comment=Shuts down system bypassing shutdown helper
Exec=xfce4-terminal -x sudo /usr/bin/magicdown.sh
Icon=/usr/share/icons/gnome/32x32/actions/gnome-shutdown.png
Terminal=false
Path=
StartupNotify=false
GenericName=Shutdown</code></pre></div><p>What I get on the terminal screen goes by too fast but with a video taken with a cell phone I could get a glimpse:</p><div class="codebox"><pre><code>s
u
sudo: unable to open log file: /var/log/sudo.log: read only file system
o</code></pre></div><p>I have a properly configured sudoers.d file that allows me to use the executable script:</p><div class="codebox"><pre><code>[root@devuan groucho]# visudo -c
/etc/sudoers: parsed OK
/etc/sudoers.d/README: parsed OK
/etc/sudoers.d/user_dmesg: parsed OK
/etc/sudoers.d/user_linssid: parsed OK
/etc/sudoers.d/user_modprobe: parsed OK
/etc/sudoers.d/user_rescan: parsed OK
/etc/sudoers.d/user_shutdown: parsed OK
/etc/sudoers.d/user_updatedb: parsed OK
[root@devuan groucho]# </code></pre></div><div class="codebox"><pre><code>[root@devuan groucho]# cat /etc/sudoers.d/user_shutdown
groucho ALL= NOPASSWD: /sbin/halt, /sbin/shutdown, /sbin/reboot, /usr/bin/magicdown.sh
[root@devuan groucho]# </code></pre></div><p>What I don&#039;t understand is not being able to open sudo.log as root.</p><p>Is there something wrong with the script?</p><p>Thanks in advance.</p><p>A.</p>]]></description>
			<author><![CDATA[dummy@example.com (Altoid)]]></author>
			<pubDate>Mon, 04 Mar 2019 16:03:33 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=14618#p14618</guid>
		</item>
	</channel>
</rss>
