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
1
Issues
1
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
183d85fa
Commit
183d85fa
authored
Dec 12, 2019
by
Mikhail Efremov
Committed by
Anton Midyukov
May 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
features/services: Add SYSTEMD_SERVICES_{ENABLE,DISABLE}
Support systemd-spicific services, e.g. *.socket amd .service units.
parent
a9acdd23
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
config.mk
features.in/services/config.mk
+2
-0
10-services
features.in/services/install2/image-scripts.d/10-services
+16
-3
10-services
features.in/services/rootfs/image-scripts.d/10-services
+6
-1
No files found.
features.in/services/config.mk
View file @
183d85fa
...
@@ -4,6 +4,8 @@ use/services: sub/rootfs
...
@@ -4,6 +4,8 @@ use/services: sub/rootfs
@$(call xport,DEFAULT_SERVICES_DISABLE)
@$(call xport,DEFAULT_SERVICES_DISABLE)
@$(call xport,SERVICES_ENABLE)
@$(call xport,SERVICES_ENABLE)
@$(call xport,SERVICES_DISABLE)
@$(call xport,SERVICES_DISABLE)
@$(call xport,SYSTEMD_SERVICES_ENABLE)
@$(call xport,SYSTEMD_SERVICES_DISABLE)
use/services/lvm2-disable: use/services
use/services/lvm2-disable: use/services
@$(call add,DEFAULT_SERVICES_DISABLE,lvm2-lvmetad)
@$(call add,DEFAULT_SERVICES_DISABLE,lvm2-lvmetad)
...
...
features.in/services/install2/image-scripts.d/10-services
View file @
183d85fa
...
@@ -13,10 +13,18 @@ CHECK_FILES=
...
@@ -13,10 +13,18 @@ CHECK_FILES=
.
shell-config
.
shell-config
switch
()
{
switch
()
{
local
sname
=
"
$1
"
sname
=
"
${
sname
%.service
}
"
sname
=
"
${
sname
%.socket
}
"
[
-n
"
$CHECK_FILES
"
]
&&
\
[
-n
"
$CHECK_FILES
"
]
&&
\
egrep
-qs
"^[[:blank:]]*
$
1
(.service|.socket)?[[:blank:]]*$"
\
egrep
-qs
"^[[:blank:]]*
$
sname
(.service|.socket)?[[:blank:]]*$"
\
$CHECK_FILES
&&
return
||
:
$CHECK_FILES
&&
return
||
:
# avoid service duplication: drop sevice without unit type
[
"
$sname
"
=
"
$1
"
]
||
shell_config_del
"
$STATUS
"
"
$sname
"
case
"
$2
"
in
case
"
$2
"
in
on|off
)
on|off
)
shell_config_set
"
$STATUS
"
"
$1
"
"
$2
"
;;
shell_config_set
"
$STATUS
"
"
$1
"
"
$2
"
;;
...
@@ -36,8 +44,13 @@ for i in $GLOBAL_DEFAULT_SERVICES_DISABLE; do switch $i off; done
...
@@ -36,8 +44,13 @@ for i in $GLOBAL_DEFAULT_SERVICES_DISABLE; do switch $i off; done
for
i
in
$GLOBAL_SERVICES_ENABLE
;
do
switch
$i
on
;
done
for
i
in
$GLOBAL_SERVICES_ENABLE
;
do
switch
$i
on
;
done
for
i
in
$GLOBAL_SERVICES_DISABLE
;
do
switch
$i
off
;
done
for
i
in
$GLOBAL_SERVICES_DISABLE
;
do
switch
$i
off
;
done
# systemd services
for
i
in
$GLOBAL_SYSTEMD_SERVICES_ENABLE
;
do
switch
$i
on
;
done
for
i
in
$GLOBAL_SYSTEMD_SERVICES_DISABLE
;
do
switch
$i
off
;
done
SERVICES
=
"
$GLOBAL_DEFAULT_SERVICES_ENABLE
$GLOBAL_DEFAULT_SERVICES_DISABLE
"
SERVICES
=
"
$GLOBAL_DEFAULT_SERVICES_ENABLE
$GLOBAL_DEFAULT_SERVICES_DISABLE
"
SERVICES
=
"
$SERVICES
$GLOBAL_SERVICES_ENABLE
$GLOBAL_SERVICES_DISABLE
"
SERVICES
=
"
$SERVICES
$GLOBAL_SERVICES_ENABLE
$GLOBAL_SERVICES_DISABLE
"
SERVICES
=
"
$SERVICES
$GLOBAL_SYSTEMD_SERVICES_ENABLE
$GLOBAL_SYSTEMD_SERVICES_DISABLE
"
SERVICES
=
"
$(
echo
$SERVICES
|
sort
-u
)
"
SERVICES
=
"
$(
echo
$SERVICES
|
sort
-u
)
"
for
i
in
$SERVICES
;
do
for
i
in
$SERVICES
;
do
...
@@ -47,7 +60,7 @@ for i in $SERVICES; do
...
@@ -47,7 +60,7 @@ for i in $SERVICES; do
done
done
if
[
-s
"
$CONFDIR
"
/services-on
]
;
then
if
[
-s
"
$CONFDIR
"
/services-on
]
;
then
if
[
-s
"
$CONFDIR
"
/systemd-enabled
]
;
then
if
[
-s
"
$CONFDIR
"
/systemd-enabled
]
||
[
-n
"
$GLOBAL_SYSTEMD_SERVICES_ENABLE
"
]
;
then
cat
"
$CONFDIR
"
/services-on
>>
"
$CONFDIR
"
/systemd-enabled
cat
"
$CONFDIR
"
/services-on
>>
"
$CONFDIR
"
/systemd-enabled
rm
"
$CONFDIR
"
/services-on
rm
"
$CONFDIR
"
/services-on
else
else
...
@@ -56,7 +69,7 @@ if [ -s "$CONFDIR"/services-on ]; then
...
@@ -56,7 +69,7 @@ if [ -s "$CONFDIR"/services-on ]; then
fi
fi
if
[
-s
"
$CONFDIR
"
/services-off
]
;
then
if
[
-s
"
$CONFDIR
"
/services-off
]
;
then
if
[
-s
"
$CONFDIR
"
/systemd-disabled
]
;
then
if
[
-s
"
$CONFDIR
"
/systemd-disabled
]
||
[
-n
"
$GLOBAL_SYSTEMD_SERVICES_DISABLE
"
]
;
then
cat
"
$CONFDIR
"
/services-off
>>
"
$CONFDIR
"
/systemd-disabled
cat
"
$CONFDIR
"
/services-off
>>
"
$CONFDIR
"
/systemd-disabled
rm
"
$CONFDIR
"
/services-off
rm
"
$CONFDIR
"
/services-off
else
else
...
...
features.in/services/rootfs/image-scripts.d/10-services
View file @
183d85fa
...
@@ -19,7 +19,7 @@ switch() {
...
@@ -19,7 +19,7 @@ switch() {
esac
esac
{
{
[
-z
"
$SYSTEMCTL
"
]
||
/bin/systemctl
--no-reload
$sc
$1
.service
[
-z
"
$SYSTEMCTL
"
]
||
/bin/systemctl
--no-reload
$sc
$1
[
-z
"
$CHKCONFIG
"
]
||
/sbin/chkconfig
$1
$cc
[
-z
"
$CHKCONFIG
"
]
||
/sbin/chkconfig
$1
$cc
}
# 2>/dev/null
}
# 2>/dev/null
}
}
...
@@ -32,4 +32,9 @@ for i in $GLOBAL_DEFAULT_SERVICES_DISABLE; do switch $i off; done
...
@@ -32,4 +32,9 @@ for i in $GLOBAL_DEFAULT_SERVICES_DISABLE; do switch $i off; done
for
i
in
$GLOBAL_SERVICES_ENABLE
;
do
switch
$i
on
;
done
for
i
in
$GLOBAL_SERVICES_ENABLE
;
do
switch
$i
on
;
done
for
i
in
$GLOBAL_SERVICES_DISABLE
;
do
switch
$i
off
;
done
for
i
in
$GLOBAL_SERVICES_DISABLE
;
do
switch
$i
off
;
done
# systemd services
CHKCONFIG
=
for
i
in
$GLOBAL_SYSTEMD_SERVICES_ENABLE
;
do
switch
$i
on
;
done
for
i
in
$GLOBAL_SYSTEMD_SERVICES_DISABLE
;
do
switch
$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