Skip to content

Instantly share code, notes, and snippets.

@immure
immure / _service.md
Last active January 11, 2017 21:26 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@immure
immure / gophish
Last active January 11, 2017 22:01
gophish service script
#!/bin/sh
### BEGIN INIT INFO
# Provides: gophish
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
[Unit]
Description=GoPhish Service
After=network.target
[Service]
ExecStart=/opt/gophish/gophish
Type=simple
PIDFile=/var/run/gophish
User=gophish
WorkingDirectory=/opt/gophish