log2ram icon indicating copy to clipboard operation
log2ram copied to clipboard

[Feature] init.d compatibility

Open MegaV0lt opened this issue 6 years ago • 23 comments

Is it possible to adapt log2 ram to init.d that is used on Gentoo Linux instead of Systemd?

MegaV0lt avatar Feb 18 '18 15:02 MegaV0lt

I think Gentoo have init.d system ?

azlux avatar Feb 19 '18 00:02 azlux

Yes, i have /etc/init.d... Sorry. At boottime on tehn screen i can see openrc starting. i think i was misunderstanding that.

MegaV0lt avatar Feb 19 '18 07:02 MegaV0lt

related to #16

azlux avatar Feb 19 '18 07:02 azlux

Are you familiar to use iniV ? I will allow init configuration, but I cannot test it here.

azlux avatar Feb 19 '18 08:02 azlux

No, sorry. Never heard about iniV

MegaV0lt avatar Feb 19 '18 09:02 MegaV0lt

Sorry the name of init.d script is sysvinit (also named SystemV), the doc say it's compatible with OpenRC What is the output of cat /proc/1/comm ?

azlux avatar Feb 19 '18 09:02 azlux

Well, minimal... Have seen already some but can not convert from systemd :-( The Gentoo i used is Gen2VDR that is a distribution bundled with VDR and Kodi to have an Linux HTPC. Bas System is Gentoo.

The reqested Output:

root auf hdvdr01 am 19.02.2018 13:52 
[~] # cat /proc/1/comm
init

MegaV0lt avatar Feb 19 '18 12:02 MegaV0lt

I found this: https://github.com/akhilvij/systemd-to-sysvinit-converter But i doubt it is much help

MegaV0lt avatar Feb 19 '18 13:02 MegaV0lt

@fugitive90 Maybe you can help with that. I see you have fork my project for FreeBSD use. We can open a branch for sysvinit compatibility.

azlux avatar Feb 19 '18 19:02 azlux

Hello everyone. Sorry didn't noticed notification. @azlux yes, I planed to made for sysvinit and open-rc, but didn't got time to finish it. I'll see what I can do.

fugitive90 avatar Apr 04 '18 23:04 fugitive90

@fugitive90 You can make changes into https://github.com/azlux/log2ram/tree/sysvinit I see you have change many function, maybe we can create a functional branch for init.d system and add other changes later.

azlux avatar Apr 07 '18 15:04 azlux

@azlux Please find me on freenode, #devuan,#alpine-linux or #artix nick ``fugitive'' so we can discuss it.

fugitive90 avatar Apr 11 '18 19:04 fugitive90

i tried to install om my VDR. But it fails:

root auf hdvdr01 am 01.06.2018 13:30 [~/log2ram-sysvinit] # bash ./install.sh ./install.sh: Zeile 14: systemctl: Kommando nicht gefunden.

Reboot to activate log2ram

MegaV0lt avatar Jun 01 '18 11:06 MegaV0lt

Does your machine run systemd? Looks like this is not the case.

Sailing74 avatar Jun 01 '18 11:06 Sailing74

Is Gentoo Linux

root auf hdvdr01 am 19.02.2018 13:52 [~] # cat /proc/1/comm init

MegaV0lt avatar Jun 01 '18 12:06 MegaV0lt

i think it is openrc-init https://wiki.gentoo.org/wiki/Init_system

MegaV0lt avatar Jun 01 '18 12:06 MegaV0lt

@MegaV0lt Sorry I cannot make the init script for gentoo. I never use it. If you think you can do it, I will create a Branch for that.

azlux avatar Jun 01 '18 13:06 azlux

I have several raspberry pis running Rasbian (Debian 7) which still uses init instead of systemd. I don't know if a solution for init on Rasbian might benefit the Gentoo distro in any way?

karlh626 avatar Jun 06 '18 17:06 karlh626

Gen2VDR (Gentoo) is using init.d-Scripts. Example:

root auf hdvdr01 am 07.06.2018 08:31 
[~] # cat /etc/init.d/ntpd
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

description="ntpd - the network time protocol daemon"
pidfile="/var/run/ntpd.pid"
command="/usr/sbin/ntpd"
command_args="-p ${pidfile} ${NTPD_OPTS}"
start_stop_daemon_args="--pidfile ${pidfile}"

depend() {
	use net dns logger
	after ntp-client
}

start_pre() {
	if [ ! -f /etc/ntp.conf ] ; then
		eerror "Please create /etc/ntp.conf"
		return 1
	fi
	return 0
}

start-stop-deamion is also in some scripts

MegaV0lt avatar Jun 07 '18 06:06 MegaV0lt

I started a attempt to include detection of init-system and install/uninstall files acording to the init-system. My first try looks good so far. You can take a look here: https://github.com/MegaV0lt/log2ram

MegaV0lt avatar Sep 23 '19 14:09 MegaV0lt

Is it just recent update broke openrc support?

fhoshino avatar May 11 '20 14:05 fhoshino

What update you mean?

MegaV0lt avatar May 11 '20 14:05 MegaV0lt

Never mind, I just copied the old open-rc script from another alpine box and it works now, just guessing recent update removed / broke open-rc support

fhoshino avatar May 11 '20 15:05 fhoshino