Re: [DNG] dnsmaq on devuan
John Crisp wrote on 23.03.2018 02:22: > I have been having some struggles running dnsmasq on Devuan Jessie. > > After a lot of head scratching I started to realise the init file seems > a touch out of whack. For starters, no pid file is generated when you > start dnsmasq. > > There I was thinking I was stopping and starting it when in reality, I > was just adding more instances ! That would then explain why the new > settings I kept trying seemed to fail miserably. Doh > > I do not have resolvconf installed. > > dnsmasq 2.72-3+deb8u2 > > I just wanted a simple caching nameserver for VPN clients with some > simple static upstream DNS nameservers set. > > I can sit down and slowly debug my way through the init file but > wondered if anyone else had any experiences with this? Hi John, I routinely have dnsmasq running on my Devuan ASCII box (was running Debian testing/jessie before) and never observed any irregularities. I checked and the PID file is correctly maintained, issuing service start/stop/status commands works as expected. (dnsmasq 2.76-5+deb9u1) For comparison I tested again on a Devuan Jessie VM (dnsmasq version 2.72-3+deb8u2, same as yours) with identical positive results. No resolvconf installed on both systems. The dnsmasq init scripts in Jessie and ASCII differ basically just in the relocation /var/run --> /run. But since the former should be just a symlink to the latter on both systems it should not have any noticeable effect at all. For reference I attached a diff between the two versions. Whatever causes you trouble, I strongly believe it's not the dnsmasq init script per se that is to blame. Sorry I cannot provide you with an instant solution for your problem. HTH, best regards Urban P.S.: Yes, I too find the file time stamps in the diff slightly irritating, but I double checked I was comparing the correct files. I did not inspect the respective source packages though. -- Sapere aude! --- dnsmasq.jessie 2017-10-01 19:17:30.0 +0200 +++ dnsmasq.ascii 2017-10-01 17:20:45.0 +0200 @@ -8,7 +8,8 @@ # Description:DHCP and DNS server ### END INIT INFO -set +e # Don't exit on error status +# Don't exit on error status +set +e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/dnsmasq @@ -29,12 +30,11 @@ export LANG fi -# /etc/dnsmasq.d/README is a non-conffile installed by the dnsmasq package. -# Should the dnsmasq package be removed, the following test ensures that -# the daemon is no longer started, even if the dnsmasq-base package is -# still in place. -test -e /etc/dnsmasq.d/README || exit 0 - +# The following test ensures the dnsmasq service is not started, when the +# package 'dnsmasq' is removed but not purged, even if the dnsmasq-base +# package is still in place. +test -e /usr/share/dnsmasq/installed-marker || exit 0 + test -x $DAEMON || exit 0 # Provide skeleton LSB log functions for backports which don't have LSB functions. @@ -81,7 +81,7 @@ [ "$IGNORE_RESOLVCONF" != "yes" ] && [ -x /sbin/resolvconf ] then - RESOLV_CONF=/var/run/dnsmasq/resolv.conf + RESOLV_CONF=/run/dnsmasq/resolv.conf fi for INTERFACE in $DNSMASQ_INTERFACE; do @@ -121,16 +121,16 @@ # 1 if daemon was already running # 2 if daemon could not be started -# /var/run may be volatile, so we need to ensure that -# /var/run/dnsmasq exists here as well as in postinst -if [ ! -d /var/run/dnsmasq ]; then - mkdir /var/run/dnsmasq || return 2 - chown dnsmasq:nogroup /var/run/dnsmasq || return 2 +# /run may be volatile, so we need to ensure that +# /run/dnsmasq exists here as well as in postinst +if [ ! -d /run/dnsmasq ]; then + mkdir /run/dnsmasq || return 2 + chown dnsmasq:nogroup /run/dnsmasq || return 2 fi - start-stop-daemon --start --quiet --pidfile /var/run/dnsmasq/$NAME.pid --exec $DAEMON --test > /dev/null || return 1 - start-stop-daemon --start --quiet --pidfile /var/run/dnsmasq/$NAME.pid --exec $DAEMON -- \ - -x /var/run/dnsmasq/$NAME.pid \ + start-stop-daemon --start --quiet --pidfile /run/dnsmasq/$NAME.pid --exec $DAEMON --test > /dev/null || return 1 + start-stop-daemon --start --quiet --pidfile /run/dnsmasq/$NAME.pid --exec $DAEMON -- \ + -x /run/dnsmasq/$NAME.pid \ ${MAILHOSTNAME:+ -m $MAILHOSTNAME} \ ${MAILTARGET:+ -t $MAILTARGET} \ ${DNSMASQ_USER:+ -u $DNSMASQ_USER} \ @@ -167,7 +167,7 @@ # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile /var/run/dnsmasq/$NAME.pid --name $NAME + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile /run/dnsmasq/$NAME.pid --name $NAME } stop_resolvconf() @@ -185,9 +185,9 @@ # 1 if daemon is dead and pid file exists # 3 if daemon is not running # 4 if daemon status is unknown -
[DNG] dnsmaq on devuan
I have been having some struggles running dnsmasq on Devuan Jessie. After a lot of head scratching I started to realise the init file seems a touch out of whack. For starters, no pid file is generated when you start dnsmasq. There I was thinking I was stopping and starting it when in reality, I was just adding more instances ! That would then explain why the new settings I kept trying seemed to fail miserably. Doh I do not have resolvconf installed. dnsmasq 2.72-3+deb8u2 I just wanted a simple caching nameserver for VPN clients with some simple static upstream DNS nameservers set. I can sit down and slowly debug my way through the init file but wondered if anyone else had any experiences with this? B. Rgds John signature.asc Description: OpenPGP digital signature ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
Re: [DNG] Init script for running fio as a service
On Thu, 22 Mar 2018 17:37:36 +0100 Martin Steigerwaldwrote: > Hello KatolaZ. > > KatolaZ - 22.03.18, 15:40: > > On Thu, Mar 22, 2018 at 02:00:23PM +0100, Martin Steigerwald > > wrote: > […] > > > I am working on updating my fio debian package. I chose to > > > install the systemd service file for those who use a default > > > Debian system with systemd. > > > > > > However I also like to provide an init script for people who use > > > Devuan or Debian with sysvinit. > […] > > > I started a quick hack on an init script, but seems > > > start-stop-daemon does not really work as I thought it would. > > > > > > I attach my attempt to create an init script. > > > > It looks to me like you need to specify both "--server" and > > "--daemonize" as options to fio, otherwise it won't launch itself > > as a backend server. But I am not an expert of fio... > > And you are completely right. I didn´t know fio had this option. > > So I was able to shorten the init script to: > > DESC="Flexible I/O Tester as service" > DAEMON=/usr/bin/fio > DAEMON_ARGS='--server --daemonize /run/fio.pid' > PIDFILE='/run/fio.pid' > > and in the process also improve the systemd service file, I adapted > from what was in the upstream source as an example. > > Now I just need to dig out how to integrate the init script, but I > think its a simple override of dh_installinit with "--no-enable" as a > parameter. I do not want the service to run by default. > > Thanks for your remark that helped to improve that package even > further. > > BTW: I also accept other configuration files of other init, as long > as someone writes and tests them. Maybe I can go by example here and > show that it is possible to have init freedom in packages I > maintain. :) > > Thanks, I don't have a Devuan VM initted by runit, so the following info would need to be tested by someone who does. Assuming fio is to be run as root group root, which I infer from your message, the run script in the service directory looks like the following: #!/bin/sh exec /usr/bin/fio --server If your --server needs any args, they should appear after --server. DO NOT use --daemonize in runit: runit handles backgrounding by itself. Because you don't want this thing to start on boot, place an empty file called "down" inside the service directory. That way the admin will need to start up the daemon explicitly. Like I say, I don't have the setup to test this thing, but it can probably help somebody who does. HTH, SteveT Steve Litt April 2018 featured book: Troubleshooting Techniques of the Successful Technologist http://www.troubleshooters.com/techniques ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
[DNG] awk deepcopy demonstration
Hi all, Awk has two kinds of variables: scalars which are strings or ints or floats, and arrays. Arrays are more like LUA tables or Python dicts or Perl hashes in that you can use any scalar as a subscript. Multidimensional arrays are doable but require care and attention. The following code crashes, complaining that you're using array a in a scalar context: a[1] = "whatever" b = a A deepcopy operation is the only real way to copy an array in awk. So I've written deepcopy.awk as a demonstration of a working awk deepcopy function. See the code at http://troubleshooters.com/codecorn/awk/stuff/deepcopy.awk SteveT Steve Litt April 2018 featured book: Troubleshooting Techniques of the Successful Technologist http://www.troubleshooters.com/techniques ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
Re: [DNG] Init script for running fio as a service
Hello KatolaZ. KatolaZ - 22.03.18, 15:40: > On Thu, Mar 22, 2018 at 02:00:23PM +0100, Martin Steigerwald wrote: […] > > I am working on updating my fio debian package. I chose to install the > > systemd service file for those who use a default Debian system with > > systemd. > > > > However I also like to provide an init script for people who use Devuan or > > Debian with sysvinit. […] > > I started a quick hack on an init script, but seems start-stop-daemon does > > not really work as I thought it would. > > > > I attach my attempt to create an init script. > > It looks to me like you need to specify both "--server" and > "--daemonize" as options to fio, otherwise it won't launch itself as a > backend server. But I am not an expert of fio... And you are completely right. I didn´t know fio had this option. So I was able to shorten the init script to: DESC="Flexible I/O Tester as service" DAEMON=/usr/bin/fio DAEMON_ARGS='--server --daemonize /run/fio.pid' PIDFILE='/run/fio.pid' and in the process also improve the systemd service file, I adapted from what was in the upstream source as an example. Now I just need to dig out how to integrate the init script, but I think its a simple override of dh_installinit with "--no-enable" as a parameter. I do not want the service to run by default. Thanks for your remark that helped to improve that package even further. BTW: I also accept other configuration files of other init, as long as someone writes and tests them. Maybe I can go by example here and show that it is possible to have init freedom in packages I maintain. :) Thanks, -- Martin ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
Re: [DNG] Init script for running fio as a service
On Thu, Mar 22, 2018 at 02:00:23PM +0100, Martin Steigerwald wrote: > Hello. > > I am working on updating my fio debian package. I chose to install the > systemd > service file for those who use a default Debian system with systemd. > > However I also like to provide an init script for people who use Devuan or > Debian with sysvinit. Hi Martin, thanks a lot for your email and for your offer :) > > I started a quick hack on an init script, but seems start-stop-daemon does > not > really work as I thought it would. > > I attach my attempt to create an init script. > It looks to me like you need to specify both "--server" and "--daemonize" as options to fio, otherwise it won't launch itself as a backend server. But I am not an expert of fio... My2Cents KatolaZ -- [ ~.,_ Enzo Nicosia aka KatolaZ - Devuan -- Freaknet Medialab ] [ "+. katolaz [at] freaknet.org --- katolaz [at] yahoo.it ] [ @) http://kalos.mine.nu --- Devuan GNU + Linux User ] [ @@) http://maths.qmul.ac.uk/~vnicosia -- GPG: 0B5F062F ] [ (@@@) Twitter: @KatolaZ - skype: katolaz -- github: KatolaZ ] signature.asc Description: Digital signature ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
[DNG] Init script for running fio as a service
Hello. I am working on updating my fio debian package. I chose to install the systemd service file for those who use a default Debian system with systemd. However I also like to provide an init script for people who use Devuan or Debian with sysvinit. I started a quick hack on an init script, but seems start-stop-daemon does not really work as I thought it would. I attach my attempt to create an init script. /etc/init.d/fio start: - It starts fio as a service - It starts it twice (despite what the manpage of start-stop-daemon tells) - I am using "--background" option however /etc/init.d/fio stop: - It waits for 30 seconds, although fio responds to a TERM signal immediately - It then probably sends the KILL signal to it - It stops all fio processes, even a running fio client that runs a benchmark currently (zsh: killed fio ssd-test.fio31.9%][r=0KiB/s,w=73.1MiB/s] [r=0,w=18.7k IOPS][eta 01m:02s]) Of course I like it to just start one process, and stop exactly this process. It appears to me I have to write starting and stopping of myself instead of relying on /etc/init.d/skeleton (man init-d-script). It appears to me that when daemon process does not create PID file, then start-stop-daemon does not really appear to work as advertised in its manpage. That is where I ask for help: If anyone is experienced how to write init script for this case in a reliable way, feel free to, and I include it in the packaging as an alternative to the systemd service file. Current systemd service in use: [Unit] Description=Flexible I/O Tester as service After=network.target Documentation=man:fio(1) [Service] Type=simple ExecStart=/usr/bin/fio --server Thanks, -- Martin fio Description: application/shellscript ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
[DNG] Sharing netinstalls [Was: Re: Does devuan install from USB really need a CDROM?
On 20.03.18 09:20, KatolaZ wrote: > > dpkg --get-selections > package_list > dpkg --set-selections < package_list > Many thanks, KatolaZ. Notes taken, and quickly tried. It is something I've (too idly) long thought would be very nice to have - though I was only thinking in terms of the packages I've installed. On 20.03.18 15:08, Florian Zieboll wrote: > On Tue, 20 Mar 2018 20:04:12 +1100 > Erik Christiansenwrote: > > > I've used dpkg -i on a single deb on several occasions, but that would > > be tedious and error prone for a whole distro. > > Yes, that would probably end up in a mess, especially when you want to > cleanly remove no longer needed dependencies after uninstalling some > package... > > ...but you can just copy/mount the content of /var/cache/apt/archives/ > of your full installation into the same directory of a new minimal > installation and run apt-get update: Apt will then get the debs from > there. Ah-ha, that's an elegantly simple syncing method. I like it greatly, and look forward to the chance to try it out - after I have the first devuan install working. Thanks to you both, Erik ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
Re: [DNG] Solved with Jessie netinst, but not Ascii. [Was: Re: Does devuan install from USB really need a CDROM?
Hi, Erik Christiansen writes: > On 20.03.18 15:26, Florian Zieboll wrote: >> >> On Tue, 20 Mar 2018 19:58:08 +1100 >> Erik Christiansenwrote: >> >> > "isolinux.bin missing or corrupt. >> > DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER" >> >> That looks like you used some 3rd-party tool like unetbootin to create >> the boot-stick. The easiest way, as stated by Didier Kryn earlier in >> this thread, would be to simply 'dd' the iso to the raw device. > > I first thought "Ah goody, mistakes are fine so long as I learn from > them.", but then I did a ^r on the commandline to check, and found: > > (reverse-i-search)`dd': dd > if=~/Downloads/devuan_ascii_2.0.0-beta_i386_NETINST.iso of=/dev/sdb1 > bs=512k Shouldn't that be of=/dev/sdb, without the 1? But last time I copied an installer ISO to a stick, I simply used the cp command. See https://www.debian.org/releases/stable/amd64/ch04s03.html.en > There had been debian 9 on that stick, placed with unetbootin, but I'd > expected the dd to fully overwrite it. I might try doing it all again, > after I overcome a more immediate problem. > > The dd of Jessie netinst did copy OK, and install, but there's a boot > problem with it, and I'll start another subthread to keep things > coherent. Boot problem, you say? Well it might be just that you've put the image in the first partition of the stick rather than on the stick itself. Hope this helps, -- Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9 Support Free Softwarehttps://my.fsf.org/donate Join the Free Software Foundation https://my.fsf.org/join ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
[DNG] Devuan jessie booting to a blank screen [Was: Re: Solved with Jessie netinst, but not Ascii.
On 20.03.18 19:58, Erik Christiansen wrote: > On 19.03.18 11:46, Florian Zieboll wrote: > > as a workaround, I'd try to use the netinstall image, if there's a > > connection available for that machine. > > Thanks Florian, that worked with devuan_jessie_1.0.0_i386_NETINST.iso After the netinstall finished, jessie boots, scrolling a bunch of textual info up the screen, complete with comforting green [OK] flags on many lines - then the screen goes blank, after a spray of coloured dots across the screen, and nothing further eventuates. It's too fast for me to catch much of the text, coming at ten lines a second or more. I'm not sure if it's relevant that it's an HDMI monitor, but if the code drives that during the early boot sequence, would it switch to something else later? And the screen isn't totally black, as it was for a second earlier in the boot - there's a dim almost-black overall illumination. Any hints would fall on dry soil, as I'm a little perplexed as to the next step when the critter won't talk to me at all. Erik ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
Re: [DNG] Solved with Jessie netinst, but not Ascii. [Was: Re: Does devuan install from USB really need a CDROM?
On 20.03.18 15:26, Florian Zieboll wrote: > > On Tue, 20 Mar 2018 19:58:08 +1100 > Erik Christiansenwrote: > > > "isolinux.bin missing or corrupt. > > DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER" > > That looks like you used some 3rd-party tool like unetbootin to create > the boot-stick. The easiest way, as stated by Didier Kryn earlier in > this thread, would be to simply 'dd' the iso to the raw device. I first thought "Ah goody, mistakes are fine so long as I learn from them.", but then I did a ^r on the commandline to check, and found: (reverse-i-search)`dd': dd if=~/Downloads/devuan_ascii_2.0.0-beta_i386_NETINST.iso of=/dev/sdb1 bs=512k There had been debian 9 on that stick, placed with unetbootin, but I'd expected the dd to fully overwrite it. I might try doing it all again, after I overcome a more immediate problem. The dd of Jessie netinst did copy OK, and install, but there's a boot problem with it, and I'll start another subthread to keep things coherent. Erik ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng