Answer the question
In order to leave comments, you need to log in
How to add a command to execute after a server restart?
Installed Dante SOCKS5 server on ubuntu 16
After rebooting via Putty as root, I execute the command
/home/dante/sbin/sockd -f /home/dante/danted.conf -D
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
@reboot root /home/dante/sbin/sockd -f /home/dante/danted.conf -D
#
Answer the question
In order to leave comments, you need to log in
How were they set? If through apt, then during installation, the script for autorun should also be installed. Well, one way or another, write a service for systemd yourself.
Added to cron with the last line,
/etc/crontab does not work
Writing a unit for systemd is best. After all, it's a demon.
> Installed on ubuntu 16
LTS like 18.04
Do you need to run this once or always after system startup?
In the second case, you need to start as all daemons like Apache start. About FreeBSD, I would answer - I know where the start scripts are.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question