After the upgrade from Ubuntu14.04 to Ubuntu15.04, rc. local is invalid because Ubuntu15.04 uses the systemd management to start up, so I set my shadowsocks to start up again. 1. Add the Startup File $ cd/lib/systemd/system/$ sudovimsslocal@myserver.servicessloca under/lib/systemd/system/$
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 detailed http://www.linuxidc.com/Linux/2015-04/115937.htm
Why is systemd so quickly adopted? Http://www.linuxidc.com/Linux/2014-08/105789.htm
Systemd and sysVinit Color comparison table http://www.linuxidc.com/Linux/2014-09/106455.htm
So useful! Run the systemd command to manage the Linux system! Http://www.linuxidc.com/Linux/2014-09/106490.htm
Linux init system initialization, Part 1: Systemd http://www.linuxidc.com/Linux/2014-12/110383.htm
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2016-04/129727.htm