From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] systemd policy - different names for systemd and sysV.
Date: Fri, 11 May 2012 22:31:28 +0400
Message-ID: <20120511183128.GA3702@altlinux.org> (raw)
In-Reply-To: <20120511111606.GA19617@dad.imath.kiev.ua>
[-- Attachment #1: Type: text/plain, Size: 1564 bytes --]
On Fri, May 11, 2012 at 02:16:07PM +0300, Igor Vlasenko wrote:
> Господа,
> когда имя systemd сервиса отличается от имени sysV init скрипта,
> возникает вопрос, что писать в %post/un_service <name>.
> 
> Естественно, хочется писать в %post/un_service 
> имя sysV init скрипта.
> 
> Если сделать симлинк systemd сервиса с sysV init именем,
> например, bluetoothd.service -> bluetooth.service
> service <sysV init имя> start/stop работать будет.
> 
> Проблема в том, что chkconfig <sysV init имя> on / off
> не работает, даже если есть симлинк, поскольку эта функциональность
> считается неправильной в systemctl.
> 
> Это плохо, так как не позволяет писать скрипты, одинаково
> работающие хоть под sysV init, хоть под systemd.
> 
> Однако нам ничто не мешает пропатчить chkconfig,
> чтобы он разрешал симлинк в настоящее имя systemd сервиса.
> 
> Пример такого достаточно тривиального патча к chkconfig
> приложен в аттачменте (chkconfig-2.patch).
> 
> Предлагаю патчить chkconfig (не обязательно предложенным патчем)
Патч, в принципе, логичный, и (с точностью до кода проверки суффикса)
применимый.  Только не логичнее ли применить это изменение прямо в
systemctl?  Есть ли какие-нибудь причины патчить именно chkconfig,
а не systemctl?
> +	/* wheather the end of realName ends with .service */
> +	if (strncmp (realName+strlen(realName)-sizeof(".service"),
> +		     ".service", sizeof(".service")) != 0) {
Если вдруг strlen(realName) окажется меньше sizeof(".service"), то
может получиться не очень хорошо.
-- 
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply	other threads:[~2012-05-11 18:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11 11:16 Igor Vlasenko
2012-05-11 18:31 ` Dmitry V. Levin [this message]
2012-05-11 19:19   ` Igor Vlasenko
2012-05-11 19:36     ` Igor Vlasenko
2012-05-18  9:55       ` Alexey Shabalin
2012-05-18 10:19         ` Dmitry V. Levin
2012-05-18 10:51           ` Alexey Shabalin
2012-05-18 15:07             ` Dmitry V. Levin
2012-05-18 16:05               ` Alexey Shabalin
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=20120511183128.GA3702@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=devel@lists.altlinux.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
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git