forked from fedora-sysv/chkconfig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Broken out of PR fedora-sysv#135. Work can be continued/picked up at a later point in time. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
- Loading branch information
Showing
7 changed files
with
101 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/sh | ||
|
||
# Already symlinked, nothing to do | ||
if [[ -L /var/lib/alternatives ]]; then | ||
exit 0; | ||
fi | ||
|
||
# Make sure that the admindir exists | ||
mkdir -p /etc/alternatives.admindir | ||
|
||
# Migrate the contents | ||
if [[ -d /var/lib/alternatives ]]; then | ||
mv /var/lib/alternatives/* /etc/alternatives.admindir | ||
rm -r /var/lib/alternatives | ||
fi | ||
|
||
# Create the symlink | ||
ln -s /etc/alternatives.admindir /var/lib/alternatives |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[Unit] | ||
Description=Migrate /var/lib/alternatives to /etc/alternatives.admindir | ||
Documentation=man:alternatives(8) | ||
|
||
# This should run before any other daemons/tools that may use alternatives | ||
DefaultDependencies=no | ||
After=sysinit.target | ||
Before=basic.target shutdown.target | ||
Conflicts=shutdown.target | ||
# In case /var is remote-mounted | ||
RequiresMountsFor=/var | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/libexec/alternatives-migration | ||
|
||
[Install] | ||
WantedBy=default.target |