0

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.

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?

700 Software
  • 2,267

1 Answers1

0

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
700 Software
  • 2,267