[systemd-devel] vgetty under systemd
Ryan Nelson
ryan.freedesktop at rnelnet.com
Sun Jul 17 10:45:15 PDT 2011
On 7/16/2011 1:20 PM, Lennart Poettering wrote:
> On Sat, 16.07.11 10:43, Ryan Nelson (ryan.freedesktop at rnelnet.com) wrote:
>
>>
>> Ok, so I read more on systemd (and the man page for inittab) and
>> came up with a basic vgetty.service that I'm using with systemd.
>> After doing little ready its pretty easy.
>>
>> So I wanted to ask if I can make my service file better than this:
>>
>> --snip /lib/systemd/system/vgetty.service--
>> # This file is part of systemd.
>> #
>> # systemd is free software; you can redistribute it and/or modify it
>> # under the terms of the GNU General Public License as published by
>> # the Free Software Foundation; either version 2 of the License, or
>> # (at your option) any later version.
> This file isn't really part of systemd, is it? So the header can go...
Changed
>
>> [Unit]
>> Description=Program to answer voice calls using Vgetty
>> After=syslog.target
>>
>> [Service]
>> ExecStart=-/sbin/vgetty /dev/ttyS2
>> Restart=always
>> RestartSec=0
>> KillMode=process
> Why KillMode=process?
It was part of the example, it should work as you only need to kill
vgetty but control-group would work too, removed the KillMode option.
>
>> [Install]
>> WantedBy=multi-user.target
> As mentioned in my other response: consider making this a template you
> can easily enable for multiple ports by symlinking it to
> vgett at ttyS0.service, vgetty at ttyS1.service and so on.
Right, but then how many do you include. So I took at look at the getty
on and it has "BindTo=dev-%i.device" where does %i come from. Can I use
this in a vgetty.service implementation so I don't have to specify the
device?
--snip vgetty.service--
# This is a basic .service file used with systemd to control vgetty.
#
# Vgetty turns your voice modem into an answering machine.
# It is apart of the mgetty package. http://alpha.greenie.net/vgetty/
[Unit]
Description=Vgetty turns your voice modem into an answering machine
After=syslog.target
[Service]
ExecStart=-/sbin/vgetty /dev/ttyS2
Restart=always
RestartSec=0
[Install]
WantedBy=multi-user.target
--end snip--
More information about the systemd-devel
mailing list