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?

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to