public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: covici@ccs.covici.com
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] numlock script and systemd
Date: Sun, 08 Jun 2014 22:39:43 -0400	[thread overview]
Message-ID: <16364.1402281583@ccs.covici.com> (raw)

Hi.  I would like to use my /etc/init.d/numlock script with systemd, but
systemctl start just says warning numlock is already starting.  I
thought that if a service  was not there it would use something in
/etc/init.d and create one, so what am I doing wrong?

Here is the script
----------cut here ----------
#!/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

description="Turns numlock on for the consoles."

ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}

depend()
{
	need localmount
	keyword -openvz -prefix -vserver -lxc
}

_setleds()
{
	[ -z "$1" ] && return 1

	local dev=/dev/tty t= i=1 retval=0
	[ -d /dev/vc ] && dev=/dev/vc/

	while [ $i -le $ttyn ]; do
		setleds -D "$1"num < $dev$i || retval=1
		: $(( i += 1 ))
	done

	return $retval
}

start()
{
	ebegin "Enabling numlock on ttys"
	_setleds +
	eend $? "Failed to enable numlock"
}

stop()
{
	ebegin "Disabling numlock on ttys"
	_setleds -
	eend $? "Failed to disable numlock"
}
------------- cut here ----------

It does work under openrc.

Thanks in advance for any suggestions.

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici
         covici@ccs.covici.com


             reply	other threads:[~2014-06-09  2:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09  2:39 covici [this message]
2014-06-09  4:00 ` [gentoo-user] numlock script and systemd Canek Peláez Valdés
2014-06-09  5:48   ` covici

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16364.1402281583@ccs.covici.com \
    --to=covici@ccs.covici.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox