From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A7ABF1396D0 for ; Sat, 16 Sep 2017 19:56:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9ACD11FC0B8; Sat, 16 Sep 2017 19:56:11 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 39AF61FC008 for ; Sat, 16 Sep 2017 19:56:11 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 7BE6040846F9 for ; Sat, 16 Sep 2017 22:56:09 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id USdt4YtLAf-u90CxX09; Sat, 16 Sep 2017 22:56:09 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id UegNomgUSn-u8IGsjWC; Sat, 16 Sep 2017 22:56:08 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: "Vadim A. Misbakh-Soloviov" To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did) Date: Sun, 17 Sep 2017 02:56:08 +0700 Message-ID: <3005176.dSsCWkhPpk@note> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: 12e7aac3-2e7e-40a0-ad48-89407db16177 X-Archives-Hash: 9bd54475fc23b9c265984c5a91129710 Hi there! Every time I switch from mastering service on my work (Ubuntu-powered) to my own server farm (Gentoo powered) I'm going a bit frustrated: Ubuntu (with all my hate to many other things in it) has nice user-friendly way of managing services: you can freely call any of `service action` irrelevant to which init-system is currently in use. Will it be systemd, or (whatever there is alternative there). `service` wrapper will detect it anyway and will do the proper things (forward it to either systemd or another service manager). I'd like to suggest to remove `service` widget from openrc and make it the part of (which package? baselayout?)? Here is a pseudocode of how I see it: ``` servicename=${1} action=${2} if in_systemd; then systemctl "${action}" "${servicename}" else rc-service "${servicename}" "${action}" fi ``` Well, actually, there may be some more logic (for example, instance units (`unit@instance` in `systemd` vs `unit.instance` in openrc), "enable" action (forward it to `rc-update add` for `openrc`, probably) and maybe some more. But anyway, the conception is something like that. What do you think about that? P.S. actually, it also would be nice to add "generators" thing to it too, to make it possible to manage services that have no systemd's units under SystemD and services that have only units under OpenRC (well, that one looks much harder than first variant, but, again, looks like deb/ubuntu guys did that work already and we can try to use their work as cheatsheet)