How to Set Up Auto-Start Services on Linux Boot

How to Set Up Linux Services to Start at Boot
 
    1. Place the startup command in /etc/rc.local.
    Edit the /etc/rc.local file.
    As shown below: you can add a direct service start command or a shell script.
 
    bash /etc/init.d/webstart start
    bash /etc/init.d/redis
 
    The programs run above are all executed with root privileges. If you need a program to run as a specific user, you can do this:
 
    su show -c /home/show/server/tomcat/bin/startup.sh
 
    2. chkconfig Command
 
    [root@localhost ~]# chkconfig –list     Display services that are set to start automatically at boot
    [root@localhost ~]# chkconfig –add *** Add a service to start automatically at boot
    [root@localhost ~]# chkconfig –del ***   Remove a service from starting automatically at boot
 

Leave a Comment

Your email address will not be published.