Skip to content

Commit

Permalink
Improve /dev/log symbolic link setup to only create it if missing (#49)
Browse files Browse the repository at this point in the history
This fixes cases where the symbolic link is already present in the
system, such as in the latest Ubuntu images.

If `/dev/log` already exists, the script skips the link creation to
avoid the following error message:

  [9/14] Set /dev/log symbolic link to /run/systemd/journal/dev-log ...
  ln: failed to create symbolic link '/dev/log': Permission denied

Issue: #49
  • Loading branch information
psaavedra committed Sep 29, 2024
1 parent de09882 commit f663026
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/container-only/.wkdev-init
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ try_setup_setgid_subuid_files() {

try_setup_journal_dev_log() {

task_step "Set /dev/log symbolic link to /run/systemd/journal/dev-log ..."
sudo ln -sf /run/systemd/journal/dev-log /dev/log
task_step "Check if /dev/log exists, if not set symbolic link to /run/systemd/journal/dev-log ..."
if [ ! -e /dev/log ]; then
sudo ln -s /run/systemd/journal/dev-log /dev/log
echo " -> /dev/log symbolic link created."
else
echo " -> /dev/log already exists, skipping symbolic link creation."
fi
}

try_setup_sudoers_file() {
Expand Down

0 comments on commit f663026

Please sign in to comment.