This patch adds verification of service files provided under the ISU
(Individual Service Upgrade) mechanism.
Change-Id: I86afe2cc5c99169c79976298498377a51b3182d6
(cherry picked from commit
fb0d6f178adf203296cb2d71c7caec8efdb05c20)
# function to find and check service file in systemd directory (system session)
function find_system_service
{
- for line in `find "$system_unit_dir" -type f -name "*service" 2> /dev/null`
+ for line in `find "$system_unit_dir" $isu_system_unit_dir -type f -name "*service" 2> /dev/null`
do
uid="$(cat $line | grep "User=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')"
gid="$(cat $line | grep "Group=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')"
# function to find and check service file in systemd directory
function find_system_socket
{
- for line in `find "$system_unit_dir" -type f -name "*.socket" 2> /dev/null`
+ for line in `find "$system_unit_dir" $isu_system_unit_dir -type f -name "*.socket" 2> /dev/null`
do
# check # of [Socket]
if [ "$(cat $line | grep '\[Socket\]' | wc -l)" != "1" ]
then
check_multi_socket_case $line
- else
+ else
SocketUser="$(cat $line | grep "SocketUser=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')"
SocketGroup="$(cat $line | grep "SocketGroup=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')"
SocketMode="$(cat $line | grep "SocketMode=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')"
systemd_socket_list_csv="$cur_dir/systemd_socket.csv"
systemd_service_list="$cur_dir/systemd_service.list"
systemd_socket_list="$cur_dir/systemd_socket.list"
+# asterisk represents configuration subdirectories for ISU packages
+# their names must directly correspond to the package names
+# (e.g., dlog for the dlog package, deviced for the deviced package etc.)
+isu_system_unit_dir="/etc/isu/*/system-services/"
# function to move service file to another directory. This socket cannot be used.
# $1 : file path, $2 : file name