Ubuntu15.04 systemd add boot start

Source: Internet
Author: User
Tags comparison table

Ubuntu15.04 systemd add boot start

After upgrading from Ubuntu 14.04 to Ubuntu 15.04, rc. local is invalid because Ubuntu 15.04 uses systemd to manage startup, so I set my shadowsocks to start up.

1. Add the Startup File under/lib/systemd/system /.

$ Cd/lib/systemd/system/
$ Sudo vim sslocal@myserver.service.

The sslocal@myserver.service content is:

[Unit]
Description = Shadowsocks Client Start
Afterdomainnetwork.tar get

[Service]
Type = simple
User = liuxu
ExecStart =/home/liuxu/. local/bin/sslocal-c/home/liuxu/. local/conf/shadowsocks/% I. json

[Install]
Wantedbypolicmulti-user.tar get

The file description and startup sequence are set under [Unit]. After the network is started, because shadowsocks is a proxy, it can be set only after the network is set.

Set the Type Startup Mode under [Service], the User sets the startup User, and ExecStart is the startup command

[Install], which is the old version of inittab.

2. Soft connect this file to/etc/systemd/system/multi-user.target.wants.

$ Ln-s/lib/systemd/system/sslocal@myserver.service/etc/systemd/system/multi-user.target.wants/sslocal@myserver.service

$ Ls-l/etc/systemd/system/multi-user.target.wants/sslocal@myserver.service
Lrwxrwxrwx 1 root 44 December 26 19:30/etc/systemd/system/multi-user.target.wants/sslocal@myserver.service->/lib/systemd/system/sslocal@myserver.service

CentOS7/RHEL7 systemd

Why is systemd so quickly adopted?

Systemd and sysVinit Color comparison table

So useful! Run the systemd command to manage the Linux system!

Analysis of Linux init system initialization, Part 1: Systemd

This article permanently updates the link address:

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.