Comment Re: SystemD added? (Score 1) 494
Editing an init script is never the solution to a problem unless you ARE the maintainer of the distribution.
Or, you know, when there's a way to identify and communicate with said maintainer.
Editing an init script is never the solution to a problem unless you ARE the maintainer of the distribution.
Or, you know, when there's a way to identify and communicate with said maintainer.
Well, there is probably a lot of even more complicated methods.
I'm sorry to hear it.
Now if you just need a simple static address I would suggest to use systemd-networkd: https://wiki.archlinux.org/ind...
Oh, neat. So instead of writing two scripts (all w/ bashisms), a configuration file and a unit file, the "next best" way is to run yet another 13.000-lines C program (cat src/network/network[cd]*.[ch] | wc -l).
I can't even tell if you're trolling or just a good example of demonstrating what's wrong with systemd mindset.
I hope this one is simple enough for your use case.
No, it's not; and more to the point, I don't have a real "use case". As said:
The other day I had a spare machine sitting around [.........] [and then] I nuked [it]
You see, I already have two good solutions and this little experimental journey into the Arch world just made clear that if I hadn't moved to the BSDs back in the day, I'd do it now. Thanks, though.
printf 'up\n192.168.1.42/24 media autoselect\n' >/etc/ifconfig.xyz0
printf 'defaultroute=(gateway addr)' >>/etc/rc.conf
I also faintly remember how to do that on non-systemd Linux, for instance in Debian it's adding 2-3 lines to
So far, so good. Now, let's see how this is done when systemd is involved, the following is copypasted right from the Arch wiki
Persistent configuration on boot using systemd
First create a configuration file for the systemd service, replace interface with the proper network interface name:
address=192.168.1.2
netmask=24
broadcast=192.168.1.255
gateway=192.168.1.1
Create a network start script:
#!/bin/bash
ip link set dev "$1" up
ip addr add ${address}/${netmask} broadcast ${broadcast} dev "$1"
[[ -z ${gateway} ]] || {
ip route add default via ${gateway}
}
Network stop script:
#!/bin/bash
ip addr flush dev "$1"
ip route flush dev "$1"
ip link set dev "$1" down
Make both scripts executable:
# chmod +x
systemd service file:
[Unit]
Description=Network connectivity (%i)
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/net-conf-%i
ExecStart=/usr/local/bin/net-up.sh %i
ExecStop=/usr/local/bin/net-down.sh %i
[Install]
WantedBy=multi-user.target
Enable and start the unit network@interface, replacing interface with the name of your interface.
Source
Hilarious, right? It's so simple! And it totally does away with those pesky shell script, yet in order to do something as simple as configuring a static IP, the user is told to create two shell scripts, apart from the systemd "unit file" and the file that contains the actual address.
At that point I nuked the machine and called myself lucky for not having to cope with this shit.
Your comment has too few characters per line (currently 24.9).
Please ignore everything below;
The log file is expected to reside in the
How did it take you that long to read the handful of comments that existed at the time?
because it couldn't make more clear how (as per
Therefore it could have been a funny and subtle troll as well; thanks for ruling out that possibility
Besides, It's also very possible that the poster just reads
Standards don't mean a damned thing because standards change
wtf? for instance?
And it should be the law: If you use the word `paradigm' without knowing what the dictionary says it means, you go to jail. No exceptions. -- David Jones