All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
How to start shadowsocks-go on boot?
I just installed shadowsocks-go (not the standard version of shadowsocks) in a VPS and it works great as long as I'm logged in with PuTTY. As soon as I shut down, poof, the program drops out of memory. So I found out that if you do a little magic, you can get it to run in the background and I put that in a script. So now, how can I configure the server to execute the script on startup and run the program in the background?
CentOS 5.10
Install path: /root/go/bin/shadowsocks-server
Config file in same folder.
The script that starts the program:
#!/bin/bash
cd ~/go/bin/
./shadowsocks-server > log &
That runs the service when I'm logged in with Putty and puts it in the background. To try to get it to run on boot, I've added this line to the /etc/rc.d/rd.local file:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
sh /root/startSocks.sh
But that doesn't seem to start it on boot and I'm still forced to log in and hand start it with my script. Any ideas of where is my mistake?
Comments
You need to run it in either a screen session, or with nohup. Preferably a screen session. Otherwise, it'll lose its terminal and die.
You could try Upstart:
shadowsocks-go.conf
Install as an Upstart job on your system (should be on CentOS by default). Then reboot.
The script starts when networking and the file system is ready (prevents crashing on some systems).
To manually control it just use the service commands:
service shadowsocks-go start
service shadowsocks-go stop
service shadowsocks-go restart
service shadowsocks-go status
A resource incase you run into trouble and need to know what to Google :P
http://www.openlogic.com/wazi/bid/281586/How-to-write-CentOS-initialization-scripts-with-Upstart