Commit Graph

35 Commits

Author SHA1 Message Date
Maycon Santos e6fe74ca0a validate systemctl command 2022-08-31 17:58:43 +02:00
Maycon Santos 43eac3eb40 validate systemctl command 2022-08-31 17:55:07 +02: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
tomfeigin bc65850ac5 Allow setting environment variables for services (#312)
Setting environment variables for services running with systemd, OSx or
windows
2022-04-27 07:11:36 -05:00
tomfeigin ff1da96551 Run systemd commands with --user flag (#310)
When controlling a user service with systemd supply the --user flag
2022-04-27 07:10:17 -05:00
Tomasz Maczukin 3b7119afcd Fix interaction with systemd (#274)
The library is using inconsistent names when calling `systemctl`
commands.

Let's say that the service is named `name`. The unit file will be
then named `name.service` - this is the popular pattern used also by
this library.

While for most common commands like `systemctl start` there is no
difference whether `name` or `name.service` will be used as the service
identifier, the `list-unit-files` command expects explicitly the unit
file name.

Currently just the name - without the `.service` suffix - is being used,
which causes the command to return no output, not match the name of the
service and finally respond the status of installed but inactive service
as `StatusUnknown` with `ErrNotInstalled` error. While `StatusStopped`
without any error is expected.

Considering `systemctl` behavior it's just easier to:

- have one method that constructs the `name.service` name,
- use it for all `systemctl` commands calls.

And this is the change that this commit is adding.
2021-06-10 06:40:54 -05:00
Oliver Kraemer 258d7b252b Run commands as user on systemd when using user service (#224) 2020-11-16 08:55:05 -06:00
Blake Rouse 60dcbae4c5 Fix issue with systemd inactive status. (#243) 2020-11-16 08:52:11 -06:00
Simon Backx a1c091bc7f Added LimitNOFILE option in systemd configuration (#94)
Co-authored-by: Daniel Theophanes <kardianos@gmail.com>
2020-06-07 11:51:47 -07:00
Julius Berger ec63d01a8d support systemd user services (#185) 2020-06-07 11:34:08 -07:00
SteelPhase 15406c80f4 Return a better status for "activating" 2020-06-07 11:14:48 -07:00
Anthony "Ishpeck" Tedjamulia 5ab104476c Fixing systemd complaint that service configurations are world-inaccessible after install 2020-06-07 10:36:36 -07:00
Rozen Lin fffe6c52ed Support the systemd option setting for 'Restart' and 'SuccessExitStatus (#168)
* support the dependency config for linux systemd

* remote the binary file incorrectly added

* Support the systemd option setting for 'Restart' and 'SuccessExitStatus'
2019-05-14 08:51:56 -07:00
Peter Hommel 61d6d01901 Linux systemd: two small fixes (#171)
* Linux systemd: fixed bug in service configuration template. Dependencies should now work for Linux systemd.

* Linux systemd: enabled detection of systemd inside chroot environments

* Linux systemd: enabled detection of systemd inside chroot environments fix
2019-05-14 08:36:39 -07:00
RozenLin 0e5bec1b9e Systemd/dep (#165)
* support the dependency config for linux systemd

* remote the binary file incorrectly added
2019-03-26 09:10:25 -07: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 4f2cc00692 stdout/stderr isn't supported by all versions of systemd 2018-08-21 09:13:27 -07:00
SteelPhase e5178e50d2 add support for overriding service templates at runtime 2018-08-21 09:13:27 -07:00
SteelPhase 994866c14a add file logging support to systemd 2018-08-20 21:45:52 -07:00
Jesse Jarzynka bd219ce2c8 Add support for loading environment variables from optional file 2016-11-08 14:17:29 -05:00
Justin McCarthy 6636ccb00f working directory also expects cmdEscaping rules introduced in b008df209b 2016-08-22 11:45:12 -07:00
Lawrence Woodman 9ea6d25b45 Correct formatting in file 2016-07-12 05:46:52 +01:00
Daniel Theophanes 2dbca8fa3b service: add pidfile option 2016-02-08 13:59:12 -08: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