Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Hostname error when using OpenRC (Read 3200 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Hostname error when using OpenRC

Hello, I installed Artix with OpenRC, but on startup I get hostname error. However, when using s6 or runit, this error does not appear.

Code: [Select]
/etc/init.d/hostname start
* Setting hostname to [i]myhostname[/i] from /etc/hostname ...
/etc/init.d/hostname: line36: hostname: command not found
* Failed to set the hostname
* ERROR:hostname failed to start




Re: Hostname error when using OpenRC

Reply #1
It appears that OpenRC uses the "hostname" command directly when setting the hostname. Pacman tells me this is provided by inetutils. Neither runit nor s6 use the hostname program. They just redirect an echo command to /proc/sys/kernel/hostname to set the hostname.

I'm not familiar with openrc, but the s6/runit way of doing it makes more sense to me since it doesn't have any dependencies other than shell.

Re: Hostname error when using OpenRC

Reply #2
I will also add that I installed OpenRC about six months ago on another PC and I did not have this error.

Re: Hostname error when using OpenRC

Reply #3
Interesting - I guess you have none of these installed to require inetutils, and found this while others have not:
Code: [Select]
~$ pactree -sr inetutils
inetutils
├─archboot
├─etckeeper
├─grml-zsh-config
│ └─archboot
├─mariadb
│ ├─akonadi
│ │ ├─kde-development-environment-meta
│ │ ├─kdepim-runtime
│ │ │ ├─kaddressbook
│ │ │ │ └─kdepim-meta
│ │ │ │   └─kde-applications-meta
│ │ │ ├─kalarm
│ │ │ │ └─kdepim-meta
│ │ │ ├─kmail
│ │ │ │ └─kdepim-meta
│ │ │ ├─knotes
│ │ │ │ └─kdepim-meta
│ │ │ ├─korganizer
│ │ │ │ └─kdepim-meta
│ │ │ └─zanshin
│ │ └─kjots
│ ├─galera
│ ├─mysql-openrc
│ ├─mysql-runit
│ └─mysql-s6
├─metasploit
├─rabbitmq
├─testssl.sh
├─wicd
│ ├─wicd-gtk
│ ├─wicd-openrc
│ ├─wicd-runit
│ └─wicd-s6
└─xorg-xinit
  ├─displaymanager-openrc
  ├─nodm
  ├─sugar-runner
  ├─x2goserver
  └─xfce4-session

Re: Hostname error when using OpenRC

Reply #4
Indeed, the problem was the lack of inetutils. Thanks.

 

Re: [Re-SOLVED] Hostname error when using OpenRC

Reply #5
In OpenRc you use the /etc/conf.d/hostname file. I believe /etc/hostname will override it, but your errors seem to be from it needing a proper /etc/conf.d version, as below:

Code: [Select]
# /etc/conf.d/hostname for OpenRC
# Set to the fully qualified domain name (fqdn) of this machine
hostname="mybox.example.com"
# Aliases, if any
aliases="MyBox"
# NIS domain name of this machine, if it has one
#nisdomainname="localdomain.com"