I am trying to do a simple kernel verifying systemd service.
Service is:
[Unit]
Description= It checks kernel version
[Service]
ExecStart=/home/handle-kernel-version.sh $EXPECTED_KERNEL $(uname -r)
StandardOutput=journal+console
EnvironmentFile=/home/input_kernel.txt
Type=oneshot
[Install]
WantedBy=multi-user.target
Problem is, the second argument is passed as $(uname
instead of the actual kernel version. I suppose it is due to the systemd handling of escape character and I can surely bypass this issue by adding the uname line in the bash script itself, but I would like to know the solution for the oneline method nevertheless.