Bug#856031: systemd: /lib/systemd/system-shutdown/ is ignored

Michael Biebl biebl at debian.org
Fri Feb 24 13:42:11 GMT 2017


Control: forcemerge -1 856028


Am 24.02.2017 um 14:28 schrieb Frank Breitling:
> Package: systemd
> Version: 232-18
> Severity: normal
> 
> Dear Maintainer,
> 
>    I need to run a script at shutdown and reboot.
> 
>    Linking my script to /etc/rc0.d and rc6.d was not successful so I added
>       my script to /lib/systemd/system-shutdown/.
> 
>    However, my script was never executed at shutdown or reboot.
> 
>    But it should have run. It has this contents:
>       "#/bin/sh
>          touch /test"
> 

Three things:

First, your script does not have a proper shebang (missing !), use
#!/bin/sh

Second, check that the script you created is actually executable (chmod
+x ...).

Third, / might already be read-only at the time the script is run. You
need to explicitly remount / rw, i.e. something like

#!/bin/sh
mount -oremount,rw /
touch /test
mount -oremount,ro /



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20170224/a1a43715/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list