How to start python file as a service in OSX (I need both a start and a stop script) -


i want run python program/file service on osx. need start , stop script.

i have tried multiple solutions know work in linux, none seem work in osx. remember trying 1 worked if code simple 'hello world', more complex , python crash.

the code trying run works fine when 'execute' py script on terminal.

i imagine rather easy can't seem work.

ps: using % in terminal not work in situation, need start , stop script.

cheers, in advance.

i suggest use launchd this. write configuration files, place them in /system/library/launchdaemons, can start , stop them launchctl. it's not hard figure out.

you should read manpages launchctl, program used start , stop launch agents, , launchd.plist, configuration format. it's long read, not difficult ot understand. there lots of options timing , responding events, you'll need simplest. you'll find plenty of example scripts in system @ above path.


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -