Ubuntu16 Creating the Boot service

Source: Internet
Author: User

1, cd/etc/init.d/

2. Sudo touch Zookeeper (example)

3. Assigning permissions to the service: sudo chmod +x zookeeper

4. Execute sudo vim zookeeper command to write execution script (Start command in startup script corresponding to service)

#! /bin/sh### BEGIN INIT info# Short-Description:container zookeeper based on lxc# Description:container zookeeper based on lxc# provides: lxd# Required-start:no# Required-stop:no# Default-start:2 3 4 5# Default-stop:0 1 6# # # END INIT INFO./lib/lsb/init-functions Case " $" inchstart) Su-L SCZBBX-C'/home/sczbbx/zookeeper-1/zookeeper-3.5.4-beta/bin/zkserver.sh Start'Exit0    ;; Stop) Su-L SCZBBX-C'/home/sczbbx/zookeeper-1/zookeeper-3.5.4-beta/bin/zkserver.sh Stop'Exit0    ;; *) echo'require Start|stop'Exit1    ;; Esac

5. Then reload the service: sudo systemctl daemon-reload

6. Start Service: sudo service zookeeper start; End service: sudo service zookeeper stop; View System log: Tail/var/log/syslog

Ubuntu16 Creating the Boot service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.