azlux / log2ram

ramlog like for systemd (Put log into a ram folder)
MIT License
2.61k stars 192 forks source link

[Feature] init.d compatibility #48

Open MegaV0lt opened 6 years ago

MegaV0lt commented 6 years ago

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

azlux commented 6 years ago

I think Gentoo have init.d system ?

MegaV0lt commented 6 years ago

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

azlux commented 6 years ago

related to #16

azlux commented 6 years ago

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

MegaV0lt commented 6 years ago

No, sorry. Never heard about iniV

azlux commented 6 years ago

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 ?

MegaV0lt commented 6 years ago

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 commented 6 years ago

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

azlux commented 6 years ago

@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.

fugitive90 commented 6 years ago

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.

azlux commented 6 years ago

@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.

fugitive90 commented 6 years ago

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

MegaV0lt commented 6 years ago

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
Sailing74 commented 6 years ago

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

MegaV0lt commented 6 years ago

Is Gentoo Linux

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

MegaV0lt commented 6 years ago

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

azlux commented 6 years ago

@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.

karlh626 commented 6 years ago

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?

MegaV0lt commented 6 years ago

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 commented 4 years ago

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

fhoshino commented 4 years ago

Is it just recent update broke openrc support?

MegaV0lt commented 4 years ago

What update you mean?

fhoshino commented 4 years ago

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