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: