Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
labmanager-systemd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto LIVIO BECCARIA
labmanager-systemd
Commits
2be69da4
Commit
2be69da4
authored
5 years ago
by
Alberto LIVIO BECCARIA
Browse files
Options
Downloads
Patches
Plain Diff
Added a script for checking if needed systemd units are installed in the system.
parent
6adf3fbb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check-requirements.sh
+65
-0
65 additions, 0 deletions
check-requirements.sh
with
65 additions
and
0 deletions
check-requirements.sh
0 → 100644
+
65
−
0
View file @
2be69da4
#!/usr/bin/env bash
################################################################################
# Check if all required systemd units are installed in the system
################################################################################
UNITS
=(
abrtd.service
accounts-daemon.service
basic.target
display-manager.service
getty.target
graphical.target
kdm.service
multi-user.target
network-online.target
network.target
rescue.service
rescue.target
rtkit-daemon.service
sshd.service
switcheroo-control.service
systemd-update-utmp-runlevel.service
udisks2.service
usbguard.service
)
CHECK_DIRS
=(
/etc/systemd
/usr/lib/systemd
)
UNITS_LEN
=
${#
UNITS
[@]
}
# DON'T TOUCH UNDER THIS LINE! #################################################
echo
units_found
=
0
for
f
in
"
${
UNITS
[@]
}
"
do
found
=
0
for
d
in
"
${
CHECK_DIRS
[@]
}
"
do
if
[[
$found
==
0
]]
;
then
cd
$d
lines
=
$(
find
.
-name
$f
|
wc
-l
)
if
[[
$lines
!=
0
]]
then
found
=
1
units_found
=
$((
units_found+1
))
fi
fi
done
if
[[
$found
==
0
]]
;
then
echo
"Missing:
$f
"
fi
done
echo
echo
"Summary:"
echo
" - # units to check:
$UNITS_LEN
"
echo
" - # units found:
$units_found
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment