:: Re: [DNG] Runit for Devuan: was Deb…
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Olaf Meeuwissen
Datum:  
To: m712
CC: dng
Betreff: Re: [DNG] Runit for Devuan: was Debian testing drop redis
Hi,

m712 writes:

> On October 28, 2017 11:22:49 AM GMT+03:00, Rick Moen <rick@???> wrote:
>>(But sure, fixing the runit-init package
>>would be a nice-to-have.)
> I have a proposal for this. Basically, have an install script which does something like this (I'm not familiar with the Debian packaging scripts so assume it's sh):


Install scripts should not assume anything wrt the shell they're using
when OR explicitly state what shell they expect (and where necessary add
an appropriate Pre-Depends). In practice, it's easier to fix your
install script to be /bin/sh compatible.

On Debian/Devuan, /bin/sh defaults to dash.

> # if upgrading, this doesn't run
> if [ "$(pgrep runit -o)" != "1" ]; then
> mv -f /sbin/shutdown{,.old}
> mv -f /sbin/reboot{,.old}


Those are bashisms and won't work with dash

olaf@quark:~$ /bin/sh
$ mv test{,.new}
mv: missing destination file operand after ‘test{,.new}’
Try 'mv --help' for more information.

So, stop trying to be smart ;-) and just say

mv -f /sbin/shutdown /sbin/shutdown.old
mv -f /sbin/reboot /sbin/reboot.old

or

  for f in /sbin/shutdown /sbin/reboot; do
    mv -f $f $f.old
  done


or something.

Moreover, I think something like this would be better handled using
Debian's alternatives mechanism. See `man update-alternatives` for
details.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Software                        https://my.fsf.org/donate
 Join the Free Software Foundation              https://my.fsf.org/join