Skip to content
Snippets Groups Projects
Commit d902ef43 authored by Thierry Escande's avatar Thierry Escande
Browse files

openharmony-3.0: Start OpenHarmony services from pre-init script


The OpenHarmony services are now started from the pre-init script. The
script checks if the corresponding systemd services are enabled before
running them. That way, the services startup can be controlled using
systemctl.

Signed-off-by: default avatarRobert Drab <robert.drab@huawei.com>
Signed-off-by: default avatarThierry Escande <thierry.escande@huawei.com>
parent 33fee543
No related branches found
No related tags found
No related merge requests found
......@@ -82,3 +82,174 @@ chmod 666 /dev/binder
if [ -c /dev/dri/card0 ]; then
chmod 666 /dev/dri/card0
fi
install -m 755 -d /dev/unix/socket
export XDG_RUNTIME_DIR=/data/weston
export XKB_CONFIG_ROOT=/etc/openharmony/xkb
export XKB_CONFIG_EXTRA_PATH=/etc/openharmony/xkb
STARTUP_CMD_SLEEP=2
# trigger: part of the init process itself
if systemctl -q is-enabled param.service; then
/system/bin/param_service &
sleep "$STARTUP_CMD_SLEEP"
fi
# - pre-init stage
# - init stage
if systemctl -q is-enabled samgr.service; then
/system/bin/samgr &
sleep "$STARTUP_CMD_SLEEP"
fi
# - post-init stage
# - "trigger early-fs",
# - "trigger fs",
# - "trigger post-fs",
# - "trigger late-fs",
# - "trigger post-fs-data",
# - "trigger load_persist_props_action",
# - "trigger firmware_mounts_complete",
# - "trigger early-boot",
# - "trigger boot"
# trigger: late-fs
# "name" : "installs",
# "path" : ["/system/bin/installs"],
# "importance" : -20,
# "uid" : "root",
# "gid" : ["root"]
if systemctl -q is-enabled installs.service; then
/system/bin/installs & # saId 511
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: late-fs
# "name" : "appspawn",
# "path" : ["/system/bin/appspawn"],
# "importance" : -20,
# "uid" : "root",
# "gid" : ["root"]
if systemctl -q is-enabled appspawn.service; then
/system/bin/appspawn & # SA: 1401 180 3703 3008
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "mkdir /data/log/ 0770 system log",
# "mkdir /data/log/hilog/ 0750 logd log",
# "uid" : "logd",
# "gid" : "log",
# "socket" : [
# "hilogInput dgram 0666 logd logd passcred",
# "hilogControl seqpacket 0600 logd logd false"
# ]
if systemctl -q is-enabled hilogd.service; then
/system/bin/hilogd &
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "name" : "huks_service",
# "path" : ["/system/bin/sa_main", "/system/profile/huks_service.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"]
if systemctl -q is-enabled huks.service; then
/system/bin/sa_main /system/profile/huks_service.xml & # SA: 3510
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "name" : "deviceauth_service",
# "path" : ["/system/bin/deviceauth_service"],
# "uid" : "system",
# "gid" : ["system", "shell"]
if systemctl -q is-enabled deviceauth.service; then
/system/bin/deviceauth_service & # SA: 4701 | Required SA: 3510
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "name" : "accountmgr",
# "path" : ["/system/bin/sa_main", "/system/profile/accountmgr.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"],
# "writepid" : [
# "/dev/cpuset/foreground/tasks",
# "/dev/stune/foreground/tasks",
# "/dev/blkio/foreground/tasks"
# ]
if systemctl -q is-enabled accountmgr.service; then
/system/bin/sa_main /system/profile/accountmgr.xml & # SA: 200
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "name" : "softbus_server",
# "path" : ["/system/bin/sa_main", "/system/profile/softbus_server.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"]
if systemctl -q is-enabled dsoftbus.service; then
/system/bin/sa_main /system/profile/softbus_server.xml & # SA: 1401 4700 | Required SA: 3299
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: not used?
#sa_main /system/profile/dps_service.xml & # SA: 1401 180 3502
#sleep "$STARTUP_CMD_SLEEP"
# trigger: post-fs-data
# "name" : "distributedsched",
# "path" : ["/system/bin/sa_main", "/system/profile/distributedsched.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"]
if systemctl -q is-enabled distributedsched.service; then
/system/bin/sa_main /system/profile/distributedsched.xml & # SA: 1401
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: boot
# "name" : "distributeddata",
# "path" : ["/system/bin/sa_main","/system/profile/distributeddata.xml"],
# "caps" : ["DAC_READ_SEARCH"],
# "uid" : "system",
# "gid" : ["system","shell","readproc"],
# "writepid":[
# "/dev/cpuset/foreground/tasks",
# "/dev/stune/foreground/tasks",
# "/dev/blkio/foreground/tasks"
# ]
if systemctl -q is-enabled distributed_data.service; then
/system/bin/sa_main /system/profile/distributeddata.xml & # SA: 1301
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: boot
# "name" : "time_service",
# "path" : ["/system/bin/sa_main", "/system/profile/time_service.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"],
# "caps" : ["SYS_TIME", "WAKE_ALARM"]
if systemctl -q is-enabled time.service; then
/system/bin/sa_main /system/profile/time_service.xml & # SA: 1401 180 3702
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: boot
# "name" : "inputmethod_service",
# "path" : ["/system/bin/sa_main", "/system/profile/inputmethod_service.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"],
# "caps" : ["SYS_TIME"]
if systemctl -q is-enabled inputmethod.service; then
/system/bin/sa_main /system/profile/inputmethod_service.xml & # SA: 180 1401 3703
sleep "$STARTUP_CMD_SLEEP"
fi
if systemctl -q is-enabled faultloggerd.service; then
/usr/bin/install -m 775 -d /data/log/faultlog /data/log/faultlog/faultlogger /data/log/faultlog/temp/
/system/bin/faultloggerd &
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment