Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
c51c3eb4
Commit
c51c3eb4
authored
Jul 17, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distr_info: get_service_manager: use 1 process name by default
parent
a4425bbe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
distr_info
bin/distr_info
+9
-2
No files found.
bin/distr_info
View file @
c51c3eb4
...
@@ -870,15 +870,22 @@ get_virt()
...
@@ -870,15 +870,22 @@ get_virt()
# TODO: check for openvz
# TODO: check for openvz
}
}
get_init_process_name
()
{
[
!
-f
/proc/1/comm
]
&&
echo
"(unknown)"
&&
return
1
cat
/proc/1/comm |
head
-n1
#ps --no-headers -o comm 1
}
# https://unix.stackexchange.com/questions/196166/how-to-find-out-if-a-system-uses-sysv-upstart-or-systemd-initsystem
# https://unix.stackexchange.com/questions/196166/how-to-find-out-if-a-system-uses-sysv-upstart-or-systemd-initsystem
get_service_manager
()
get_service_manager
()
{
{
[
-d
/run/systemd/system
]
&&
echo
"systemd"
&&
return
[
-d
/run/systemd/system
]
&&
echo
"systemd"
&&
return
# TODO
# TODO
#[ -d /usr/share/upstart ] && echo "upstart" && return
#[ -d /usr/share/upstart ] && echo "upstart" && return
is_command systemctl
&&
cat
/proc/1/comm |
grep
-q
'systemd$'
&&
echo
"systemd"
&&
return
is_command systemctl
&&
[
"
$(
get_init_process_name
)
"
=
'systemd'
]
&&
echo
"systemd"
&&
return
[
-d
/etc/init.d
]
&&
echo
"sysvinit"
&&
return
[
-d
/etc/init.d
]
&&
echo
"sysvinit"
&&
return
echo
"(unknown)"
get_init_process_name
}
}
filter_duplicated_words
()
filter_duplicated_words
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment