The difference between starting a custom script process name in the /etc/rc.d/init.d directory and adding a daemon process

Table of Contents Differences in process names for starting custom scripts in the /etc/rc.d/init.d directory Enable daemon script in /etc/rc.d/init.d directory Differences in process names for starting custom scripts in the /etc/rc.d/init.d directory The script1 script in the /etc/rc.d/init.d directory does not run other scripts. After service script1 start is executed, the process name /etc/rc.d/init.d/script1 […]

The difference and connection between /etc/init.d and /etc/rc.local and systemctl in Linux

Table of Contents The operating level of the system (pre-knowledge) /etc/init.d About directory /etc/rc.d/init.d /etc/rc.local The difference between /etc/init.d and /etc/rc.local systemctl Summarize Notice `/etc/init.d` or `/etc/rc.local` or `systemctl` can be started The operating level of the system (pre-knowledge) Level Remarks Run level 0 System shutdown status, the system default run level cannot be set […]

Example init.d and systemd configuration

Tomcat #!/bin/sh # chkconfig: 345 99 10 # description: Auto-starts tomcat # /etc/init.d/tomcat # Tomcat auto-start # Source function library. ./etc/init.d/functions # source networking configuration. ./etc/sysconfig/network RETVAL=0 export JAVA_HOME=/usr/local/jdk export CATALINA_HOME=/usr/local/apache-tomcat export CATALINA_BASE=/usr/local/apache-tomcat function _tomcat() { local option=”$1″ if [ -f “$CATALINA_HOME/bin/tomcat.sh” ];then /bin/sh “$CATALINA_HOME/bin/tomcat.sh” “$option” RETVAL=$? return $RETVAL the fi return 1 } function […]