Commit Graph

164 Commits

Author SHA1 Message Date
Jamie Cameron
2b357cf0f1 Add function to enable an action at boot that runs as a non-root user 2021-08-15 14:04:05 -07:00
Ilia Rostovtsev
0bc86a3147 Check if opts are passed 2021-04-27 21:41:11 +03:00
Ilia Rostovtsev
8725fd83fc Add ability to utilize env 2021-04-27 16:05:09 +03:00
Ilia Rostovtsev
b64effa5f1 Add flexibility in creating systemd services 2021-04-27 15:36:56 +03:00
Jamie Cameron
84572640e7 Don't totally fail if some units can be read 2021-04-03 19:24:42 -07:00
Ilia Rostovtsev
fa2e4c87b7 Don't test for non-native services as returned status may be false-positive 2021-03-05 21:11:35 +03:00
Ilia Rostovtsev
4b82fe84c4 Fix to catch non-native systemd service output 2021-03-05 00:48:31 +03:00
Jamie Cameron
fec9b6eec6 Fix bug that caused init scripts to be ignored if in systemd mode https://www.virtualmin.com/node/70782 2021-03-03 18:07:43 -08:00
Ilia Rostovtsev
37f1d75afd Add trim sub
23adcc8bc0 (r46315725)
2021-01-25 23:34:16 +03:00
Ilia Rostovtsev
7fd42f1c3e Add better logic to test unit status
23adcc8bc0
2021-01-24 13:51:56 +03:00
Ilia Rostovtsev
64d77ae6e7 Fix to lowercase output when testing 23adcc8bc0 2021-01-23 15:06:43 +03:00
Ilia Rostovtsev
23adcc8bc0 Add support for native is-enabled command
https://sourceforge.net/p/webadmin/bugs/5447/#9431
2021-01-23 14:40:49 +03:00
Jamie Cameron
301b994855 Check for init script in all dirs https://github.com/webmin/webmin/issues/1282 2020-08-13 17:38:01 -07:00
Jamie Cameron
a2dc3f7124 Switch all calls to open() to explicitly open for read 2020-03-14 17:20:54 -07:00
Jamie Cameron
f8b96e3ccc API to reload an action 2019-10-25 20:36:24 -07:00
Jamie Cameron
031aded040 API for listing action names generically 2019-06-30 18:33:36 -07:00
Jamie Cameron
3f73bd8f1c Use single command to get status 2019-06-30 17:22:10 -07:00
Jamie Cameron
8a684d8c41 Detect and show unknown status systemd actions https://www.virtualmin.com/node/59115 2018-10-20 10:33:26 -07:00
Jamie Cameron
9f869be140 Checking for /etc/rc.d makes no sense on systemd systems https://github.com/webmin/webmin/issues/835 2018-02-28 19:46:45 -08:00
Jamie Cameron
bd0c2e7128 Limit list of unit files to services and skip headers 2018-02-25 10:45:56 -08:00
Jamie Cameron
9a350cc2f0 Limit output to services and remove legends https://github.com/webmin/webmin/issues/829 2018-02-24 17:45:30 -08:00
Jamie Cameron
fd6693ec8c Skip directories under systemd root https://github.com/webmin/webmin/issues/829 2018-02-24 13:07:37 -08:00
Joe Cooper
df6c98cdde Probably fix upstart vs systemd detection 2017-10-06 19:15:07 -05:00
Joe Cooper
15753acb2e Check for systemd before upstart 2017-08-21 16:30:31 -05:00
Jamie Cameron
2b1ee8bc77 Also unmask units when enabling https://www.virtualmin.com/node/45624 2017-03-28 07:56:35 -07:00
Jamie Cameron
99f73bd80f Filter out template units, which cause the subsequent call to systemctl show to fail https://github.com/webmin/webmin/issues/430: 2017-02-24 16:04:21 -08:00
Jamie Cameron
15e2f4a114 Remove the .service suffix https://github.com/webmin/webmin/issues/430 2016-10-14 16:54:07 -07:00
Jamie Cameron
8ab998b123 Fix creation of new actions 2016-09-30 15:36:47 -07:00
Jamie Cameron
f308101805 Also use list-unit-files to find disabled units https://github.com/webmin/webmin/issues/430 2016-09-24 15:55:43 -07:00
Jamie Cameron
f4f9b32db0 Always disable or enable if the action exists 2016-06-05 16:21:59 -07:00
Jamie Cameron
004c9194f3 Suppress errors from systemctl show https://sourceforge.net/p/webadmin/bugs/4756/ 2016-05-25 14:58:34 +02:00
Jamie Cameron
baef8aba0f If a systemd service suggests using journalctl to get more logs, do it 2016-02-05 17:36:22 -08:00
Jamie Cameron
9297c3e7f0 A bosystemdction in 'static' state is enabled https://github.com/webmin/webmin/issues/270 2015-11-30 17:36:22 -08:00
Jamie Cameron
ea7d904d90 If the runlevel couldn't be detected any other way, assume 3 http://virtualmin.com/node/37100 2015-05-22 13:52:34 -07:00
Jamie Cameron
8f0d32b764 More changes needed to support launchd 2015-05-03 10:14:03 -07:00
Jamie Cameron
ac238e37d1 More work on launchd support for MacOS X 2015-05-02 15:33:36 -07:00
Jamie Cameron
79e2bf69b4 Show at-boot setting 2015-04-28 21:34:52 -07:00
Jamie Cameron
c1105d0ac5 Add support for deleting launchd agents 2015-04-26 17:22:38 -07:00
Jamie Cameron
fdffa9ee42 Use consistent comment type 2015-04-26 16:52:34 -07:00
Jamie Cameron
cb008888bf Launchd action creation now working 2015-04-26 16:30:27 -07:00
Jamie Cameron
4b2ba48e58 Work on launchd support 2015-04-25 22:00:07 -07:00
Jamie Cameron
1a1deef64a UNit names can have spaces or funny characters at the start 2015-04-16 19:04:25 -07:00
Jamie Cameron
132ea695bc UNit names can have spaces or funny characters at the start 2015-04-16 19:03:50 -07:00
Jamie Cameron
ad46361cb0 for systemd services, the name may have .service appended 2015-03-21 17:11:19 -07:00
Jamie Cameron
895e5bbbd1 Don't fail just because some system actions can't be looked up https://sourceforge.net/p/webadmin/bugs/4522/ 2014-12-16 21:43:57 -08:00
Jamie Cameron
f73389554d Systemd units with @ in the name are legit, like virtualmin's clamd@scan 2014-09-13 16:06:21 -07:00
Jamie Cameron
7e3261c43c If systemd also shows init.d actions, prioritize the latter 2014-08-31 20:35:01 -07:00
Jamie Cameron
a7641290ad Systemd service -.slice isn't useful to show 2014-08-09 09:13:15 -07:00
Jamie Cameron
31cc6f4da5 Add function to get the curent state of some action 2014-08-08 21:53:09 -07:00
Jamie Cameron
b255d8e5b0 Add API function to deletee a bootup action 2014-02-05 16:31:37 -08:00