Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
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
1
Merge Requests
1
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
Ximper Linux
mkimage-profiles
Commits
3e30ebdb
Commit
3e30ebdb
authored
May 03, 2012
by
Gleb F-Malinovskiy
Committed by
Michael Shigorin
May 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simply: simplify 50services script
parent
4e28b094
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
30 deletions
+21
-30
50services
features.in/slinux/live/image-scripts.d/50services
+21
-30
No files found.
features.in/slinux/live/image-scripts.d/50services
View file @
3e30ebdb
#!/bin/sh -x
#!/bin/sh
# see also m-p-d::profiles/live/image-scripts.d/init3-services
SYSTEMCTL
=
/bin/systemctl
CHKCONFIG
=
/sbin/chkconfig
#[ -x /bin/systemctl ] || exit 0
#[ -x /bin/systemctl ] || exit 0
turn_on
()
{
if
[
-x
$SYSTEMCTL
]
;
then
$SYSTEMCTL
enable
${
*
}
.service
else if
[
-x
$CHKCONFIG
]
;
then
$CHKCONFIG
$*
on
else
exit
0
fi
fi
}
ENABLE
=
"
network
NetworkManager
lvm2-monitor
mdadm
"
turn_off
()
{
if
[
-x
$SYSTEMCTL
]
;
then
$SYSTEMCTL
disable
${
*
}
.service
else if
[
-x
$CHKCONFIG
]
;
then
$CHKCONFIG
$*
off
else
exit
0
fi
fi
}
# NB: dnsmasq: https://bugzilla.altlinux.org/show_bug.cgi?id=18799
# NB: sshd might be needed for some particular cases
DISABLE
=
"
sshd
"
SERVICES_TO_ENABLE
=
"NetworkManager"
SERVICES_TO_DISABLE
=
for
i
in
$SERVICES_TO_ENABLE
;
do
turn_on
$i
;
for
i
in
$ENABLE
;
do
[
-x
/bin/systemctl
]
&&
/bin/systemctl
enable
${
i
}
.service
[
-x
/sbin/chkconfig
]
&&
/sbin/chkconfig
$i
on
done
for
i
in
$SERVICES_TO_DISABLE
;
do
turn_off
$i
;
for
i
in
$DISABLE
;
do
[
-x
/bin/systemctl
]
&&
/bin/systemctl disable
${
i
}
.service
[
-x
/sbin/chkconfig
]
&&
/sbin/chkconfig
$i
off
done
:
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