Skip to content

Instantly share code, notes, and snippets.

@paulghaddad
Created October 14, 2014 15:38
Show Gist options
  • Save paulghaddad/9a6ab481d4a98e6a2b0e to your computer and use it in GitHub Desktop.
Save paulghaddad/9a6ab481d4a98e6a2b0e to your computer and use it in GitHub Desktop.
Level Up 1: Understands init scripts and can use init.d to start and stop services
1. On a Linux development VM, use init scripts to restart sshd. Y'know, just in case.
sshd requires execution with an absolute path, so use,'which sshd' to find the path: /usr/sbin/sshd
sudo service ssh start
sudo service ssh restart
2. Let's pretend you just changed your nginx config, and want to reload the changes without stopping the service altogether. Invoke the init script without any arguments to see valid choices. Now run the correct init command to parse and load the config without stopping the server.
sudo service nginx reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment