[plug] Centos openvpn question if I could
Ian Kent
raven at themaw.net
Wed Feb 1 20:25:33 WST 2012
On Wed, 2012-02-01 at 14:41 +0800, Chris Griffin wrote:
> Do you have something like a very brief systemd for idiots that I
> could kick start with?
No I don't but you can start by having a look
at /lib[64]/systemd/system. The files end with "target" or "service" and
they are called unit files. Like /lib/systemd/system/autofs.service for
autofs which essentially replaces my init script.
And that contains:
[Unit]
Description=Automounts filesystems on demand
After=network.target ypbind.service
[Service]
Type=forking
PIDFile=/run/autofs.pid
EnvironmentFile=-/etc/sysconfig/autofs
ExecStart=/usr/sbin/automount ${OPTIONS} --pid-file /run/autofs.pid
[Install]
WantedBy=multi-user.target
So, in the [Unit] secion you can see that I want network and ypbind (if
enabled) services to start before I do. Then in the [Service] section I
specify how the daemon is started. Finally the [Install] section is
similar to specifying the run level, well almost, but I need to read
about that.
Then there's the start, stop and restart actions. The systemctl command
replaces the service command or directly running the init script and the
parameters are switched around and the name corresponds to the name of
the unit file above.
For example, for the autofs service:
systemctl start autofs.service
systemctl stop autofs.service
systemctl restart autofs.service
There are ways of using systemctl to get information about what services
are enabled, disabled, active etc. but I haven't needed to do much with
that yet so maybe we can revisit that later.
All in all it's fairly straight forward.
> It would still mean I would have to use an alternative for gnome though.
When I get around to doing that for myself I'll follow up here.
Now if I can just remember that alternative I saw someone at LCA
running ... lxc or something ...
Ian
More information about the plug
mailing list