diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2013-09-19 01:35:59 +0000 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-09-19 01:35:59 +0000 |
commit | 4af0725a7eaf98d49aa1700149a72467925afb3b (patch) | |
tree | 5092d6dcbd300a4f642c9c3be4810f6ca89a55d1 | |
parent | 0944f6a261739c299495dac7fa4711ca59c22853 (diff) | |
download | init-system-helpers-4af0725a7eaf98d49aa1700149a72467925afb3b.tar.gz |
d-s-h: add safety check for unmask
-rwxr-xr-x | script/deb-systemd-helper | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/script/deb-systemd-helper b/script/deb-systemd-helper index 18ca4a4..c11f30f 100755 --- a/script/deb-systemd-helper +++ b/script/deb-systemd-helper @@ -416,7 +416,11 @@ sub unmask_service { my @entries = state_file_entries($statefile); - unlink($service_link) if -l $service_link; + if (! -l $service_link || readlink($service_link) ne '/dev/null') { + debug "Not unmasking $service_link because it is not a link to /dev/null"; + next; + } + unlink($service_link); if (@entries > 0) { my $service_path = $entries[0]; |