Skip to content

Instantly share code, notes, and snippets.

@kafkaesqu3
Last active April 19, 2018 19:09
Show Gist options
  • Select an option

  • Save kafkaesqu3/dd85ee14b5f1d3e6cb5d4301918deeca to your computer and use it in GitHub Desktop.

Select an option

Save kafkaesqu3/dd85ee14b5f1d3e6cb5d4301918deeca to your computer and use it in GitHub Desktop.
Hashview systemd service files
crackerman@gpucracker:/etc/systemd/system$ foreman export systemd ~/services
# see http://stackoverflow.com/questions/33318107/how-do-i-start-foreman-server-on-background-on-production
crackerman@gpucracker:/etc/systemd/system$ mv ~/services/* /etc/systemd/system
crackerman@gpucracker:/etc/systemd/system$ find . -type f -name "app*.service" -print0 | xargs -0 -I % sh -c 'printf "\n\n"; echo %; cat %'
./app-redis@.service
[Unit]
PartOf=app-redis.target
[Service]
User=crackerman
WorkingDirectory=/home/crackerman/hashview
Environment=PORT=%i
ExecStart=/bin/bash -lc 'exec redis-server'
Restart=always
StandardInput=null
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=%n
KillMode=mixed
TimeoutStopSec=5
./app-hashcat-worker@.service
[Unit]
PartOf=app-hashcat-worker.target
[Service]
User=crackerman
WorkingDirectory=/home/crackerman/hashview
Environment=PORT=%i
Environment=RACK_ENV=production
ExecStart=/bin/bash -lc 'TERM_CHILD=1 COUNT=1 QUEUE=hashcat exec rake resque:work'
Restart=always
StandardInput=null
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=%n
KillMode=mixed
TimeoutStopSec=5
./app-web@.service
[Unit]
PartOf=app-web.target
[Service]
User=crackerman
WorkingDirectory=/home/crackerman/hashview
Environment=PORT=%i
Environment=RACK_ENV=production
ExecStart=/bin/bash -lc 'exec ruby ./hashview.rb'
Restart=always
StandardInput=null
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=%n
KillMode=mixed
TimeoutStopSec=5
./app-background-worker@.service
[Unit]
PartOf=app-background-worker.target
[Service]
User=crackerman
WorkingDirectory=/home/crackerman/hashview
Environment=PORT=%i
Environment=RACK_ENV=production
ExecStart=/bin/bash -lc 'QUEUE=* exec rake resque:scheduler'
Restart=always
StandardInput=null
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=%n
KillMode=mixed
TimeoutStopSec=5
./app-mgmt-worker@.service
[Unit]
PartOf=app-mgmt-worker.target
[Service]
User=crackerman
WorkingDirectory=/home/crackerman/hashview
Environment=PORT=%i
Environment=RACK_ENV=production
ExecStart=/bin/bash -lc 'TERM_CHILD=1 COUNT=5 QUEUE=management exec rake resque:workers'
Restart=always
StandardInput=null
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=%n
KillMode=mixed
TimeoutStopSec=5
crackerman@gpucracker:/etc/systemd/system$ sudo service app-redis@5000 start
crackerman@gpucracker:/etc/systemd/system$ sudo service app-mgmt-worker@5100 start
crackerman@gpucracker:/etc/systemd/system$ sudo service app-hashcat-worker@5200 start
crackerman@gpucracker:/etc/systemd/system$ sudo service app-background-worker@5300 start
crackerman@gpucracker:/etc/systemd/system$ sudo service app-web@5400 start
crackerman@gpucracker:/etc/systemd/system$ sudo systemctl enable app-redis@
crackerman@gpucracker:/etc/systemd/system$ sudo systemctl enable app-mgmt-worker@
crackerman@gpucracker:/etc/systemd/system$ sudo systemctl enable app-hashcat-worker@
crackerman@gpucracker:/etc/systemd/system$ sudo systemctl enable app-background-worker@
crackerman@gpucracker:/etc/systemd/system$ sudo systemctl enable app-web@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment