[root@app2 ~]# service ss5 status
/etc/init.d/ss5: line 18: [: =: unary operator expected
● ss5.service - SYSV: This script takes care of starting and stopping ss5
Loaded: loaded (/etc/rc.d/init.d/ss5; bad; vendor preset: disabled)
Active: active (exited) since Wed 2022-04-06 01:58:39 EDT; 4min 16s ago
Docs: man:systemd-sysv-generator(8)
Process: 7984 ExecStart=/etc/rc.d/init.d/ss5 start (code=exited, status=0/SUCCESS)
Apr 06 01:58:39 app2 systemd[1]: Starting SYSV: This script takes care of starting and stopping ss5...
Apr 06 01:58:39 app2 ss5[7984]: /etc/rc.d/init.d/ss5: line 18: [: =: unary operator expected
Apr 06 01:58:39 app2 ss5[7984]: [67B blob data]
Apr 06 01:58:39 app2 ss5[7984]: Can't unlink pid file /var/run/ss5/ss5.pid
Apr 06 01:58:39 app2 ss5[7984]: done
Apr 06 01:58:39 app2 systemd[1]: Started SYSV: This script takes care of starting and stopping ss5.
我找到问题所在了,是因为ss5的pid文件导致的,默认路径位于/var/run/ss5/ss5.pid。但某些vps在重启后这个目录无缘无故消失了。每次重启系统都需要重建这个目录:/var/run/ss5。
解决方法就是:
修改pid路径。
修改方法:在文件/etc/sysconfig/ss5修改参数,指定pid路径。
修改配置后文件内容如下:
# Add startup option here
#SS5_OPTS=" -u root"
SS5_OPTS=" -p /var/run/ss5.pid"