Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Simple /etc/rc3.d startup script is not invoked?

I’m running Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-73-generic x86_64) simple install from DigitalOcean and have installed packages, etc.

Notice this startup test script:

bryan@db:~$ ls -lh /etc/rc3.d/S02test
-rwxr-xr-x 1 root root 43 May 11 20:10 /etc/rc3.d/S02test
bryan@db:~$ cat /etc/rc3.d/S02test
#!/bin/sh
echo TESTHAY "$@" > /testhay.txt
bryan@db:~$ 

But when I reboot with init 6, it does not execute.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

bryan@db:~$ ls -lh /testhay.txt
ls: cannot access '/testhay.txt': No such file or directory
bryan@db:~$ 

But running the script manually works… so, how can I make it work on reboot too?

>Solution :

This is what I ended up doing

echo -e '[Unit]\nDescription=rcsng\nRequires=zfs.target\n\n[Service]\nType=forking\nExecStart=sh /700s/start-all.sh\n\n[Install]\nWantedBy=multi-user.target' > /etc/systemd/system/700s.service
chmod 740 /etc/systemd/system/700s.service
chgrp staff /etc/systemd/system/700s.service
systemctl enable 700s
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading