一键安装脚本shadowsock和ssr共存
使用teddysun的一键安装shadowsocks-libv脚本和一键安装shadowsocksR脚本安装ss和ssr,方便是方便,但是两个脚本安装的服务都叫shadowsocks,存在冲突,这样重启以后两个服务都起不来。
所以安装完shadowsocks之后,去/etc/init.d,
mv /etc/init.d/shadowsocks /etc/init.d/shadowsocks-libev
systemctl daemon-reload
systemctl enable shadowsocks-libev
systemctl start shadowsocks-libev
这样再接着安装ssr,两个就不会冲突了。而且把ssr脚本里面的init.d/shadowsock直接该名称为shadowsockR。
这样两个服务就不会打架,可以共存了。
Starting and Stopping Services
To start a systemd
service, executing instructions in the service's unit file, use the start
command. If you are running as a non-root user, you will have to use sudo
since this will affect the state of the operating system:
sudo systemctl start application.service
As we mentioned above, systemd
knows to look for *.service
files for service management commands, so the command could just as easily be typed like this:
sudo systemctl start application
Although you may use the above format for general administration, for clarity, we will use the .service
suffix for the remainder of the commands to be explicit about the target we are operating on.
To stop a currently running service, you can use the stop
command instead:
sudo systemctl stop application.service
Restarting and Reloading
To restart a running service, you can use the restart
command:
sudo systemctl restart application.service
If the application in question is able to reload its configuration files (without restarting), you can issue the reload
command to initiate that process:
sudo systemctl reload application.service
If you are unsure whether the service has the functionality to reload its configuration, you can issue the reload-or-restart
command. This will reload the configuration in-place if available. Otherwise, it will restart the service so the new configuration is picked up:
sudo systemctl reload-or-restart application.service
Enabling and Disabling Services
The above commands are useful for starting or stopping commands during the current session. To tell systemd
to start services automatically at boot, you must enable them.
To start a service at boot, use the enable
command:
sudo systemctl enable application.service
This will create a symbolic link from the system’s copy of the service file (usually in /lib/systemd/system
or /etc/systemd/system
) into the location on disk where systemd
looks for autostart files (usually /etc/systemd/system/some_target.target.wants
. We will go over what a target is later in this guide).
To disable the service from starting automatically, you can type:
sudo systemctl disable application.service
This will remove the symbolic link that indicated that the service should be started automatically.
Keep in mind that enabling a service does not start it in the current session. If you wish to start the service and enable it at boot, you will have to issue both the start
and enable
commands.
Checking the Status of Services
To check the status of a service on your system, you can use the status
command:
systemctl status application.service