18 Commits

Author SHA1 Message Date
optim-aizawa 645b10f1a8 Add EnvVars to linux init.d (#339)
* change module name

* add init.d env

* add init.d env
2022-10-10 17:00:23 -05:00
tomfeigin abe98a9274 Provide custom log directory for posix (#311)
When running a service with posix, provide a custom path to the
service output
2022-04-28 07:56:17 -05:00
Yujie.Zhao b9d1d5b727 fix: sysv linux not support ps $pid (#299) 2021-11-04 11:38:26 -05:00
SteelPhase b1866cf769 Add ability for service to report the system managing the service (#147)
* Add ability for service to report the system managing the service

* Clarify that the output of SystemName should return the same value as Platform in most cases

* Rename SystemName to Platform to match the rest of the package

* be a little more clear in the Platform comment
2018-09-10 15:42:44 -07:00
SteelPhase 45244176fc Add support for retrieving service status (#143)
* update command execution to support returing error codes, and stdout

add function to service interface to support returning service status

clean up places where strings were being converted to strings

* Spelling fix

* Simply service Status method

Add stopped detection to launchd
Switch to case statements
Return ErrNotInstalled in situations where we should
2018-08-22 11:05:01 -07:00
SteelPhase e5178e50d2 add support for overriding service templates at runtime 2018-08-21 09:13:27 -07:00
Evgeniy Patlan f53685ef76 For does not work on dash
IN case of dash(for example default on wheezy) for operator shold be reworked
2017-09-26 09:47:04 -07:00
Jesse Jarzynka bd219ce2c8 Add support for loading environment variables from optional file 2016-11-08 14:17:29 -05:00
Jesse Jarzynka 03b7b20ce7 Fix SysV pid_file to be consistent when ran from a differently named symlink
SysV init scripts are ran on boot from symlinks in `/etc/rc.d/rc.X`, where
X is the runlevel. These symlinks are usually named something like
`S99foobar`, which is a link to the real script `foobar`. This leads to
differences in the pid_file filename and can lead to multiple processes
running. By using readlink to get the actual destination filename, the
pid_file name should always be consistent.

Resolves: #78
2016-11-03 13:33:19 -04:00
Daniel Theophanes 5f98fcd9ec service: update API to allow for programs that install their own signal handlers. 2016-02-05 09:48:50 -08:00
Daniel Theophanes 5ab7ce2c8f service: fix misc typos. 2015-09-01 09:34:29 -07:00
Daniel Theophanes 4841cf3be4 service: move UserService field to Option. Update readme. Remove beta tag. 2015-05-01 08:15:06 -07:00
Daniel Theophanes bf10e852e1 sysv: support working directory. 2015-04-19 17:14:10 -07:00
Daniel Theophanes 49d681e0cb service: add Config.Executable field to allow service to control other binaries. 2015-03-14 08:49:17 -07:00
Daniel Theophanes 17f5541e81 service: return better error messages from executed commands. 2015-03-14 08:14:25 -07:00
Rob Napier 4d849b25a4 Remove os.Kill from POSIX platforms where it can't be caught 2015-03-13 17:52:30 -04:00
Rob Napier 34797be7d7 Run() should watch for SIGTERM on POSIX platforms 2015-03-13 15:53:26 -04:00
Daniel Theophanes c880387dea service: break out each linux service into its own file.
Breaking apart each service reduces the overall number of branches
in the code, but increases duplication. Duplication can be taken
care of in follow-up commits while still keeping the clarity of
linear code.

Also expiriment with code that would allow the user to add or remove
systems. Still expirimental and not exposed in the API.
2015-03-08 17:29:10 -07:00