How Do I Enable Startup Services on Linux?
Contents the Traditional Way to Start Services in Linux Was to Place a Script in /Etc/Init. D, and Then Use the Update-Rc. D Command (Or in Redhat Based...
Contents
The traditional way to start services in Linux was to place a script in /etc/init. d , and then use the update-rc. d command (or in RedHat based distros, chkconfig ) to enable or disable it.
How do I start a service at startup in Linux?
Look the steps below.
- Open /etc/rc.local file with this command: vim /etc/rc.local.
- Add your script that you want to run on boot process there, for example: sh /home/ivan/iptables.sh echo ‘Iptable Configured!’
- Review the comments included in that file and make sure an exit 0 is at the end.
- Save the files.
How do I enable services in Linux?
How to enable and disable services in Systemd init
- To start a service in systemd run the command as shown: systemctl start service-name. …
- Output ● …
- To stop the service running service systemctl stop apache2. …
- Output ● …
- To enable apache2 service on boot up run. …
- To disable apache2 service on boot up run systemctl disable apache2.
23 мар. 2018 г.