Coder Social home page Coder Social logo

minirc's Introduction

Hey there!

I only use this account for collaborations on projects hosted on GitHub.

My main work can be found on https://codeberg.org/yuni

"Why not on GitHub? It's so much more visible/convenient!"

Sure, it is. But come on. Seriously? Hosting free/open source software on a commercial, closed-source platform run by Microsoft? I can not comprehend how this is an actual thing.

Have you heard of embrace, extend, extinguish? Or enshittification? Even today, Microsoft appropriates all code hosted on GitHub and sells it back to us through GitHub Copilot.

GitHub was an interesting experiment but let's move back to community-owned, decentralized, free and open source platforms.

minirc's People

Contributors

bbenne10 avatar fluxer avatar halosghost avatar hut avatar thechauffeur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minirc's Issues

locked out when remotely running "rc restart sshd"

If you run "rc restart sshd" on a remote machine that you log in via ssh, the connection is terminated after sshd is stopped and rc is killed before it has the chance to start sshd again.

As a result you're locked out of the machine. This can be avoided by running the command in screen or tmux.

Experimental Branches

@HalosGhost @mrgreen3 I pushed 4 branches that take minirc in different directions and I would like to hear your opinions on them

daemonsonly branch

https://github.com/hut/minirc/tree/daemonsonly
Here the system initialization stuff from the on_boot function has been turned into pseudo-daemons which can be added or removed through the DEFAULT_DAEMONS variable. That way, the user can manipulate the boot process without changing the executable, change the order of the operations, and so on.

minirc.d branch

https://github.com/hut/minirc/tree/minirc.d
The minirc.d branch moves the start/stop scripts into another directory, /etc/minirc.d/, where each service has its own file, much like how sysvinit worked. The user can add and modify services without manipulating the binary. The downside is that the user needs to maintain more files and its more difficult to see what code is custom and what is upstream.

minirc.sysinit branch

https://github.com/hut/minirc/tree/minirc.sysinit
This moves /sbin/rc to /etc/minirc.sysinit, which, much like /etc/rc.sysinit, initializes the system and so on. The configuration is done in /etc/minirc.local. Also there is still a symlink from /sbin/rc to /etc/minirc.sysinit. It looks a little like the devel branch plus a default config file.

override_daemons

https://github.com/hut/minirc/tree/override_daemons
This branch builds upon minirc.sysinit. In addition, the user can define the function "custom_start" where own start commands for new services can be defined or existing ones can be overwritten. Same goes for "custom_stop" and "custom_poll". The downside of this system is that programs can't really install their own initscript as easily as in the minirc.d branch, but the advantage is that all the configuration is in one file. Perhaps this can be combined with the daemonsonly branch so the user can even customize the boot process.

Now I think that renaming /sbin/rc to /etc/minirc.sysinit and /etc/minirc.conf to /etc/minirc.local in the minirc.sysinit branch was a bad idea. I think the names should be reverted.

eudev

I am having a lot of difficulty installing eudev, it fails when it tries to install (libsystemd and systemd). Mdev allows X to start but I have no keyboard or mouse.

Issue/question about rc

Hey,

I hope there's someone here still :)

So I've been digging a bit through minirc lately, and I stumbled upon something curious.

I'm using the minirc Arch package.

There is a line in inittab that calls the rc script:

::shutdown:/sbin/rc shutdown

which then causes the following code to execute:


on_shutdown() {
    #===================
    # stop the default daemons
    echo_color 3 stopping daemons...
    custom_stop all

    #===================
    # load minirc.local.shutdown
    if [ -x /etc/minirc.local.shutdown ]; then
        echo_color 3 loading /etc/minirc.local.shutdown...
        /etc/minirc.local.shutdown
    fi

The thing is, minirc.local.shutdown is never actually executed. You can put a line behind custom_stop all and it will never execute on shutdown. I debugged this a bit, tracked custom_stop to default_stop all and this piece of code:

default_stop() {
    echo_color 1 stopping "$1"...
    case "$1" in
    all)
        for dmn in $DAEMONS $ENABLED; do
            custom_poll "${dmn##@}" && custom_stop "${dmn##@}"
        done;;

So I debugged this further and found out that if I rewrite this code like this:

default_stop() {
    echo_color 1 stopping "$1"...
    case "$1" in
    all)
        for dmn in $DAEMONS $ENABLED; do
            custom_poll "${dmn##@}" && custom_stop "${dmn##@}"
        done
        echo "something";;

then on_shutdown proceedes as expected and executes minirc.local.shutdown.

I don't understand, why is this the case? Is bash syntax error somewhere causing this strange behavior?

Regards,

Igor

No working init in RonixOS

So I'm the developer of RonixOS and I'm trying to get this to work with my distro but every time I start minirc, I get the no working init error with error -2, I have a ramdisk setup which is similar to a basic Arch Linux one. The system should just boot but no matter what I do, nothing works.

Possible use of runit, part of busybox

Am currently using minirc with runit, as it is shipped with busybox it only seemed natural to use it. Still early days yet but am really hoping I can get it working. Biggest problem I have had with other init systems was power options.... Ignite (for me at least) refuses to poweroff.

If anyone is interested I will post too arch forum thread when I have something more solid to work with

Mr Green

dbus

I am still having problems with dbus, cannot remember how I got it working. dbus-nosystemd is installed and /run/dbus is present. Really hoping I can get cmst to run in tint2.

Documentation and Packaging

I know you said that you were not particularly interested in creating a package for this, but I actually feel like it would be doable so long as there would be a man page detailing some of the necessary customization work.

I already have a fairly functional PKGBUILD setup, and I would be happy to write a man page for this (along with a zsh completion script when I get the free-time). If you would prefer that it not be packaged, then I won't upload it to the AUR or anything, but I actually don't feel that it would be so problematic.

Use where for udevd/udevadm.

My distro (CRUX) stores udevd and udevadm in /sbin, but the script only looks in /usr/bin, I think I simple where solves this.

Shutdown command

Given that the package automatically links halt, reboot and power-off, it would be a trivial matter to create a basic script to emulate the shutdown command. And /sbin/shutdown is only owned by systemd-sysvcompat and sysvinit, so there's no issue with including this. I'd be happy to whip this up really quickly since busybox doesn't supply a shutdown applet.

Is there any interest in this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.