SCIENTIFIC-LINUX-USERS Archives

August 2015

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Sun, 30 Aug 2015 08:45:58 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (55 lines)
On Sun, Aug 30, 2015 at 3:53 AM, ToddAndMargo <[log in to unmask]> wrote:
> On 08/30/2015 12:23 AM, Tom H wrote:
>>
>> Even if you just have one command, writing a systemd unit isn't much
>> more work than adding a line to rc.local.
>>
>> I have the following on my laptop in order to create a bridge for kvm:
>>
>> # cat /etc/systemd/system/tom-kvm-bridge0.service
>> [Unit]
>> Description=KVM Bridge0
>> After=network-online.target
>> After=tom-kvm-masquerade.service
>> Requires=tom-kvm-masquerade.service
>>
>> [Service]
>> Type=oneshot
>> ExecStart=/home/root/bin/p-kvm-bridge0-up.sh
>> ExecStop=/home/root/bin/p-kvm-bridge0-down.sh
>> RemainAfterExit=yes
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>> ("/home/root" isn't root's homedir)
>>
>> It's less work than writing a sysvinit script so it's easier to avoid
>> using rc.local and it allows you to target the startup conditions more
>> accurately (and start/stop/restart that job on its own). Distributions
>> differ in their treatment of rc.local. If you were kicking off your
>> iptables rules via rc.local on SL, you'd be OK (I think). But if you
>> were doing so on Debian or Ubuntu, you'd be kicking them off after
>> bringing up the network because Debian adds the following fragment:
>>
>> # cat /lib/systemd/system/rc-local.service.d/debian.conf
>> [Unit]
>> # not specified by LSB, but has been behaving that way in Debian under
>> SysV
>> # init and upstart
>> After=network-online.target
>>
>> # Often contains status messages which users expect to see on the console
>> # during boot
>> [Service]
>> StandardOutput=journal+console
>> StandardError=journal+console
>
> That is about 50 times more work than what I am doing.

Possibly 3x...

Whether on Solaris or Linux, whenever I've hacked rc.local, I've
eventually replaced the edit with an smf/systemd/sysvinit/upstart
native file.

ATOM RSS1 RSS2