You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
smeserver-runit/createlinks

36 lines
1.2 KiB
Perl

#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
sub panel_link
{
my ($function, $panel) = @_;
unlink "root/etc/e-smith/web/panels/$panel/cgi-bin/$function";
symlink("../../../functions/$function",
"root/etc/e-smith/web/panels/$panel/cgi-bin/$function")
or die "Can't symlink to root/etc/e-smith/web/panels/$panel".
"/cgi-bin/$function: $!";
}
sub event_link2
{
my ($action, $event, $level) = @_;
unlink "root/etc/e-smith/events/${event}/S${level}${action}";
symlink("../actions/${action}",
"root/etc/e-smith/events/${event}/S${level}${action}")
or die "Can't symlink to root/etc/e-smith/events/${event}/S${level}${action}:".
" $!";
}
foreach my $target (qw(basic))
{
system('mkdir -p root/usr/lib/systemd/system/'.$target.'.target.wants/');
symlink("../runit.service",
"root/usr/lib/systemd/system/$target.target.wants/runit.service")
or die "Can't symlink to root/usr/lib/systemd/system/$target.target.wants/runit.service: $!";
}
my $event="smeserver-runit-update";
event_link("systemd-reload", $event, "89");
event_link("systemd-default", $event, "88");
safe_symlink("start", "root/etc/e-smith/events/$event/services2adjust/runit");