Energenie EG-PMS User Manual Page 12

  • Download
  • Add to my manuals
  • Print
  • Page
    / 30
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 11
pickups Documentation, Release 0.7.0
registerpickup(configfile)
if __name__ == "__main__":
main()
which will register a custom signal handler for you handling KeyboardInterrupts.
Note: Using this method registers a custom signal handler, thus stay in the main thread.
Using a context manager, pickups.helpers.register() simply registers a custom signal handler on
signal.SIGTERM for the given pickups.bamboo.bamboopickup.BambooPickup class.
3.2.2 Running as a service
If you want to run this script as a linux service, you can use systemd. One can write a service file to start pickups
like this:
[Unit]
Description=Pickups
[Service]
ExecStart=/usr/bin/python2.7 /home/maiksen/bamboorunner/src/runner.py
KillSignal=SIGTERM
[Install]
WantedBy=multi-user.target
On Arch-Linux the script should be put to /etc/systemd/system/pickups.service. You can start / stop it
by invoking:
$ systemctl start pickups.system
$ systemctl stop pickups.system
Note: Before starting and stopping the newly created file invoke systemctl daemon-reload.
If one would want to run pickups as a real daemon (double forking etc), feel free to extend it with capabilities to
write pidfiles and fork the process. Other use-cases may want to use cron to call an actual implementation of
pickups.basepickup.update_status() directly. This can be done using:
$ bamboopickup = BambooPickup(configfile)
% bamboopickup.update_status()
3.3 Developer Documentation
3.3.1 Get Started
This guide aims to get you started developing on pickups. To find out on how to contribute, have a look at Contributing.
Fork the project on Github using Fork A Repo
Clone your fork to get a local copy:
# https
$ git clone https://github.com/YOUR-USERNAME/pickups
8 Chapter 3. Contents:
Page view 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17 ... 29 30

Comments to this Manuals

No comments