<?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=5305&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / init script for stubby]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=5305</link>
		<description><![CDATA[The most recent posts in init script for stubby.]]></description>
		<lastBuildDate>Sun, 18 Jan 2026 11:58:47 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=61398#p61398</link>
			<description><![CDATA[<p>There is an official initscript (by me) for stubby in ceres. So far no one has committed to wanting to install it from excalibur/trixie-backports but that could be an option if there were demand.</p><p>Here it is: <a href="https://sources.debian.org/src/getdns/1.7.3-3/debian/stubby.init" rel="nofollow">https://sources.debian.org/src/getdns/1 … tubby.init</a></p>]]></description>
			<author><![CDATA[dummy@example.com (abower)]]></author>
			<pubDate>Sun, 18 Jan 2026 11:58:47 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=61398#p61398</guid>
		</item>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=61373#p61373</link>
			<description><![CDATA[<p>Last year i tried to rewrite my script to use start-stop-daemon. But then dnsmasq ceased to co-operate. Maybe the version Daedalus includes has a problem with running on localhost.</p>]]></description>
			<author><![CDATA[dummy@example.com (nahkhiirmees)]]></author>
			<pubDate>Sat, 17 Jan 2026 16:13:34 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=61373#p61373</guid>
		</item>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=50687#p50687</link>
			<description><![CDATA[<div class="codebox"><pre><code>#!/bin/sh

### BEGIN INIT INFO
# Provides: stubby
# Required-Start: $network $remote_fs $syslog
# Required-Stop:  $network $remote_fs $syslog
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# Description: a dns resolver
### END INIT INFO

#. /lib/lsb/init-functions

case &quot;$1&quot; in
  start)
	test -f /run/stubby.pid || install -o stubby -g stubby -m 600 /dev/null /run/stubby.pid
	su - stubby -c &quot;stubby &amp;&quot;
	;;
 stop)
	killall stubby
	rm /run/stubby.pid
        ;;
  *)
        echo &quot;Usage: $SCRIPTNAME start&quot; &gt;&amp;2
        exit 3
        ;;
esac</code></pre></div><p>This should work OK.&#160; Untested, I don&#039;t have <span class="bbc">stubby</span> installed. Main goal is get rid of <span class="bbc">sudo</span> for you.</p><p>If the <span class="bbc">stubby</span> program writes to the PID fill it could be used to <span class="bbc">kill</span> with instead.</p>]]></description>
			<author><![CDATA[dummy@example.com (tux2bsd)]]></author>
			<pubDate>Tue, 25 Jun 2024 09:43:09 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=50687#p50687</guid>
		</item>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=50342#p50342</link>
			<description><![CDATA[<p>Found already the manpage of start-stop-deamon . Planning to rewrite that &quot;stubby-script&quot; when i get tired of solving the gray_screen_problem.</p>]]></description>
			<author><![CDATA[dummy@example.com (nahkhiirmees)]]></author>
			<pubDate>Wed, 05 Jun 2024 22:57:00 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=50342#p50342</guid>
		</item>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=50317#p50317</link>
			<description><![CDATA[<p>sudo should not be used on init scripts, not directly because of security, but it is assumed not every system may had sudo installed as a minimal install with a root account and password will only have su and require running su to change into the root account to perform all administrative tasks.</p><p>that aside in a proper initscript the variable <span class="bbc">RUN_AS_USER</span> is defined, usually as <span class="bbc">RUN_AS_USER=root</span> for daemons intended to be ran by the root user, for daemons that need to be ran under a specific user the variable is defined with the intended user.</p><p>accordingly the <span class="bbc">start-stop-daemon</span> program will be used to guarantee correct behaviour, ie check for initialization of instance and creation of the pid file.</p><p>an example standar use of start-stop-daemon would be as follows:</p><div class="codebox"><pre><code>start-stop-daemon -S --pidfile ${PIDFILE} --make-pidfile --background \
            --chuid ${RUN_AS_USER} --startas ${DAEMON} -- ${DAEMON_ARGS}</code></pre></div><p>as for the options straight from the manual:</p><div class="codebox"><pre><code>-S, --start [--] arguments
           Check  for  the existence of a specified process.  If such a process exists, start-stop-daemon does nothing, and exits with error status 1 (0 if --oknodo is specified).  If such a process does not exist, it
           starts an instance, using either the executable specified by --exec or, if specified, by --startas.  Any arguments given after -- on the command line are passed unmodified to the program being started.</code></pre></div><p>the flags and the vars passed should be descriptive enough and those are expected to be defined earlier on the initscript.</p><p>as for --background it is used with prgrams that will not fork to background by themselves.</p><p>if you want an okay example of a proper initscript file for an arbitrary daemon check <a href="https://github.com/eylles/afreq.sh" rel="nofollow">https://github.com/eylles/afreq.sh</a><br />the file acpufreq.is is the definition of the initscrip, mind you that when you write initscript files not every daemon will support options like reloading the configuration so the route that many initscripts take is to just have the restart idiom also match reload and force-reload like so:</p><div class="codebox"><pre><code>    restart|reload|force-reload)
        $0 stop &amp;&amp; sleep 3 &amp;&amp; $0 start
        ;;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (EDX-0)]]></author>
			<pubDate>Tue, 04 Jun 2024 21:54:33 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=50317#p50317</guid>
		</item>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=50304#p50304</link>
			<description><![CDATA[<p>I don&#039;t use sudo, you might be better off starting a new thread with your question. All the best.</p>]]></description>
			<author><![CDATA[dummy@example.com (GlennW)]]></author>
			<pubDate>Mon, 03 Jun 2024 22:46:41 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=50304#p50304</guid>
		</item>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=50289#p50289</link>
			<description><![CDATA[<p>Did some research, found these links:</p><p><a href="https://stackoverflow.com/questions/17956151/how-to-run-a-command-as-a-specific-user-in-an-init-script" rel="nofollow">https://stackoverflow.com/questions/179 … nit-script</a></p><p><a href="https://bitmingw.com/2017/01/22/use-sudo-in-scripts/" rel="nofollow">https://bitmingw.com/2017/01/22/use-sudo-in-scripts/</a></p><p>So, if sudo is not the recommended command, deamon/runuser/whatever_passes_for_those_in_Devuan_today is ok?</p><p>I&#039;m considering whether i should convert that service-file(?id=4865) or not?</p>]]></description>
			<author><![CDATA[dummy@example.com (nahkhiirmees)]]></author>
			<pubDate>Mon, 03 Jun 2024 14:38:18 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=50289#p50289</guid>
		</item>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=50280#p50280</link>
			<description><![CDATA[<p>Hi, in case you are waiting for HoaS to reply, he hasn&#039;t been on these forums for a while.</p>]]></description>
			<author><![CDATA[dummy@example.com (GlennW)]]></author>
			<pubDate>Mon, 03 Jun 2024 03:33:32 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=50280#p50280</guid>
		</item>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=50239#p50239</link>
			<description><![CDATA[<p>Is the problem with sudo just that &quot;you&#039;re not supposed to do thing that way&quot;. Or are there security problems involved?</p>]]></description>
			<author><![CDATA[dummy@example.com (nahkhiirmees)]]></author>
			<pubDate>Sat, 01 Jun 2024 00:25:03 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=50239#p50239</guid>
		</item>
		<item>
			<title><![CDATA[Re: init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=38064#p38064</link>
			<description><![CDATA[<p><span class="bbc">sudo</span> shouldn&#039;t be used in init scripts. There are other issues.</p><p>For a better version (along with postinst, prerm &amp; postrm scripts) see <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008931" rel="nofollow">https://bugs.debian.org/cgi-bin/bugrepo … ug=1008931</a>.</p><p>Related: <a href="https://dev1galaxy.org/viewtopic.php?id=4865" rel="nofollow">https://dev1galaxy.org/viewtopic.php?id=4865</a> ← that shows how to generate an init script from the supplied /lib/systemd/system/stubby.service unit file.</p>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Mon, 24 Oct 2022 20:54:14 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=38064#p38064</guid>
		</item>
		<item>
			<title><![CDATA[init script for stubby]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=38063#p38063</link>
			<description><![CDATA[<p>Couple months ago i tried dnsmasq and stubby. During that time i noticed that there&#039;s no init script for stubby so i wrote one:</p><div class="codebox"><pre class="vscroll"><code>#!/bin/sh

### BEGIN INIT INFO
# Provides: stubby
# Required-Start: $network $remote_fs $syslog
# Required-Stop:  $network $remote_fs $syslog
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# Description: a dns resolver
### END INIT INFO

#. /lib/lsb/init-functions

case &quot;$1&quot; in
  start)
	touch /run/stubby.pid
	chmod 600 /run/stubby.pid
	chown stubby:65534 /run/stubby.pid
	sudo -u stubby stubby -g
	;;
 stop)
	killall stubby
        ;;
  *)
        echo &quot;Usage: $SCRIPTNAME start&quot; &gt;&amp;2
        exit 3
        ;;
esac</code></pre></div><p>pretty obvious stuff. The #BEGIN ... #END - parts i copied from dnsmasq&#039;s init file or some other file and changed a few rows. <br />How about adding something like this in the stubby package?</p>]]></description>
			<author><![CDATA[dummy@example.com (nahkhiirmees)]]></author>
			<pubDate>Mon, 24 Oct 2022 20:45:01 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=38063#p38063</guid>
		</item>
	</channel>
</rss>
