Commit Graph

36 Commits

Author SHA1 Message Date
s.solodyagin a874dd2618 place systemd units in /usr/lib/systemd/system 2024-10-08 17:35:33 +03:00
Bogdan Rozhkov becf2eb62b fix: systemd service uninstall 2024-06-13 08:34:16 -05:00
Maycon Santos 3596dfaf34 Add support for Initialisation Scripts with rcS (#340)
* validate systemctl command

* validate systemctl command

* add rcS support

* only attempt to set environment if list is not empty

* check if service bin exists
2022-10-11 07:13:05 -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
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
Calin Seciu 86948c68a7 Use 'systemctl restart' when restarting instead of stop/start 2015-10-22 02:15:48 +03:00
Daniel Theophanes 5ab7ce2c8f service: fix misc typos. 2015-09-01 09:34:29 -07:00
Alan Shreve b008df209b Change escaping rules of executable paths to cope with older versions of systemd 2015-08-10 17:23:52 -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 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 3a7d893dde service: move windows and darwin to system registry.
Also add API to handle the system registry.
2015-03-11 12:42:30 -07: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