Skip to content

Instantly share code, notes, and snippets.

@Rubentxu
Forked from vipmax/systemd java service
Created June 19, 2017 07:14
Show Gist options
  • Save Rubentxu/6f2e8d4582984c031186a74e6dc13623 to your computer and use it in GitHub Desktop.
Save Rubentxu/6f2e8d4582984c031186a74e6dc13623 to your computer and use it in GitHub Desktop.
cat social/scripts/social-site.service
cat social/scripts/social-crawler.service
[Unit]
Description=Social Crawler Service
[Service]
Type=forking
WorkingDirectory=/home/nano/social/
ExecStart=/usr/bin/java -cp target/social-1.0-allinone.jar social.crawlers.CrawlerRunner &
ExecStop=/bin/kill -TERM $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
Description=Social Site Service
[Service]
User=nano
WorkingDirectory=/home/nano/social/
ExecStart=/home/nano/anaconda3/bin/python src/main/python/social_server.py
ExecStop=/bin/kill -TERM $MAINPID
Restart=always
Type=idle
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment