$ git clone https://github.com/devxoul/osx-service.git
$ cd osx-service
$ python setup.py
$ service list
* [RUNNING] nginx
* [STOPPED] mysql
$ service nginx
Usage: nginx {restart|start|status|stop}
$ sudo service nginx start
Password:
Starting nginx: nginx.
osx-service is writted in python. Just open any files in /usr/local/etc/service/services/
directory and see how it looks.
All services are subclass of Service
. Methods defined in service class are used as a command. Methods that of name starts with "_"(underscore) are not used as a command.