Reply To: how to use runit? starter problems

#61089
algori
Member

    See if using the hostname.sh service to start at boot-time helps at all.
    Edit hostname and add before exit 0
    /etc/init.d/hostname.sh start

    If I am correct, this should be run by one of the services, but not sure why it isn’t being started on your system. I have an 19.4 runit installed on a VM and tested changing /etc/hostname and /etc/hosts and then sudo hostname new-name and rebooted. The hostname stays there OK.

    I’m also not sure, what exactly the problem is. and why, anf where to look at or up, to get more helpful information for.

    and I don’t get what to do exactly, if I run

    /etc/init.d/hostname.sh start
    then yes it changes again

    
    algori@dhcppc0:~
    $ sudo /etc/init.d/hostname.sh start 
    algori@dhcppc0:~
    $ hostname
    thmus
    algori@dhcppc0:~
    $ cat /etc/hostname
    thmus
    

    but if I reboot, I’m back to how it was before.

    the second part with adding exit 0 before, I don’t exactly get,
    do you suggest I should change something in the file /etc/init.d/hostname.sh:

    PATH=/sbin:/bin
    
    . /lib/init/vars.sh
    . /lib/lsb/init-functions
    
    do_start () {
            [ -f /etc/hostname ] || return
            HOSTNAME="$(cat /etc/hostname)"
    
            [ "$VERBOSE" != no ] && log_action_begin_msg "Setting hostname to '$HOSTNAME'"
            hostname "$HOSTNAME"
            ES=$?
            [ "$VERBOSE" != no ] && log_action_end_msg $ES
            exit $ES
    }
    
    case "$1" in
      start|"")
            do_start
            ;;
      restart|reload|force-reload)
            echo "Error: argument '$1' not supported" >&2
            exit 3
            ;;
     stop)
            # No-op
            ;;
      status)
            exit 0
            ;;
      *)
            echo "Usage: hostname.sh [start|stop]" >&2
            exit 3
            ;;
    esac
    
    :
    

    I’m sorry, I know I have to learn more and a lot about all this, but I have to start somewhere. If you could advise me some to read, I’ll do!
    I’m able to understand for sure, but I have to know where to look at.

    maybe there is something wrong with the efi boot loader, can I reinstall it perhaps?

    best regards
    algori

    • This reply was modified 5 years, 3 months ago by algori.