How to make a service start in SUSE Enterprise linux

You have to add this file into desired runlevel. For example:
sudo update-rc.d my-service default
Will add it into default runlevel in Debian-based distros. Also, be sure that the file has such structure:
#!/bin/bash
case "$1" in
    start)
        #do startup commands
        ;;
    stop)
        #do stop commands
        ;;
 esac
However, in SUSE Linux there is /etc/init.d/skeleton that should be edited to create new scripts. This skeleton contains special comments (they are comments for the shell, but used by YaST) to describe on which runlevels the start/stop must be.
Once done, the script will show in YaST → System → System Services (runlevel) and can be switched on/off from there (making the links, etc).
To enable a service you can also use chkconfig, as in:
chkconfig --set someservice on
or
chkconfig --set someservice off
and the appropriate links will be created/deleted. For finer control over levels, you can use
chkconfig --level 35 someservice on

Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all