Difference between revisions of "Systemd"
From Wasya Wiki
Line 3: | Line 3: | ||
they are in /etc/systemd/system/multi-user.target.wants | they are in /etc/systemd/system/multi-user.target.wants | ||
+ | |||
+ | === Start/stop/status === | ||
+ | sudo systemctl start iro_get_chains.service | ||
+ | sudo systemctl status iro_get_chains.service | ||
=== Read logs === | === Read logs === |
Revision as of 14:22, 6 February 2023
they are in /etc/systemd/system/multi-user.target.wants
Start/stop/status
sudo systemctl start iro_get_chains.service sudo systemctl status iro_get_chains.service
Read logs
sudo journalctl -u stockwatcher.service journalctl -u nginx.service
Example service definition
This is not up to date - look in the access repo pi/readme
[Unit] Description=watch stocks [Service] Type=forking WorkingDirectory=/home/ubuntu/projects/microsites3a/current ExecStart=/home/ubuntu/.rbenv/shims/bundle exec rake ish_manager:stockwatcher ExecStop=/bin/echo nothing Restart=on-failure Environment=RAILS_ENV=production Environment=GMAIL_DOMAIN=gmail.com Environment=GMAIL_USERNAME=<numeric-email> Environment=GMAIL_PASSWORD=<password> [Install] WantedBy=multi-user.target