processes() improved parsing of all services (linux)

This commit is contained in:
Sebastian Hildebrandt
2023-01-29 20:34:50 +01:00
parent b82df5427b
commit 1eaf7d907b
4 changed files with 11 additions and 5 deletions
+2 -2
View File
@@ -151,11 +151,11 @@ function services(srv, callback) {
if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {
if ((_linux || _freebsd || _openbsd || _netbsd) && srvString === '*') {
try {
const tmpsrv = execSync('systemctl --type=service --no-legend 2> /dev/null').toString().split('\n');
const tmpsrv = execSync('systemctl --all --type=service --no-legend 2> /dev/null').toString().split('\n');
srvs = [];
for (const s of tmpsrv) {
const name = s.split('.service')[0];
if (name) {
if (name && s.indexOf(' not-found ') === -1) {
srvs.push(name.trim());
}
}