Skip to main content

Questions tagged [init]

init is the first actual process (PID 1) spawned during the boot sequence of a UNIX system. Some systems may rely on alternative solutions such as systemd or Upstart (Ubuntu).

Filter by
Sorted by
Tagged with
0 votes
1 answer
31 views

Custom initrd script failing to init "Attempted to kill init"

I am trying to create a custom ramdisk, but it keeps failing right before launching init. Here is the script: https://gist.github.com/amanuel2/f3e8bb9399f3b3bd36a90cd925ecf63d Logs: Edit 2: Logs: ...
amanuel2's user avatar
  • 101
1 vote
1 answer
32 views

Systemd: should I use wants/requires for already enabled service listed in After=

I have a systemd service named webserver.service that is wanted by multiuser.target (enabled by default on system). I have another service under another target named test.service that I want to run ...
Denny's user avatar
  • 13
0 votes
0 answers
21 views

OpenRC not starting services

For testing purposes, I need a quick way to generate a root filesystem to use for booting freshly built Linux kernels. I've been doing this by using Docker to create a filesystem and then transferring ...
larsks's user avatar
  • 35.9k
0 votes
1 answer
49 views

How is PID 1 made special and unkillable?

Using docker, I recently found that PID 1 is by default unkillable by SIGTERM. Yet you can still catch SIGTERM in PID 1 if you setup a handler in the process. So this doesn't seem to be the case of ...
rrauenza's user avatar
  • 764
0 votes
0 answers
26 views

Is the first I/O apic in the MADT table special?

Is the first I/O APIC in the madt table special? Is it always supposed to contain all the ISA IRQs if there is no legacy PIC? I heard this is called the boot-APIC, do you have a reference?
caciquekampeon's user avatar
1 vote
2 answers
40 views

Shut down actions order: write buffers after RO root remount

Exploring amazing Book How Linux Works by Brian Ward I usually have no question. But this one. At the "6.7.0 Shutting Down Your System" there is an ordered list of jobs. After remount root ...
Dmitry Dmitriev's user avatar
0 votes
1 answer
768 views

Disabling the autostart of a service from /etc/init.d without disabling the service?

I have a service that gets started via /etc/init.d at boot and that cause the final steps of the boot processes to be delayed long enough that it's possible to log in via the graphic display manager ...
RJVB's user avatar
  • 254
0 votes
1 answer
2k views

How to boot into a terminal in arch

I ran sysctl disable display-manager.service and rebooted arch thinking it would boot into a terminal. Now I'm locked out of the machine. I've tried adding init=/bin/bash to the boot options but it ...
TrevTheDev's user avatar
0 votes
0 answers
736 views

starting init: /bin/sh exists but couldn't execute it (error -8)

I'am building Root filesystem for the Linux Kernel(6.2.11). I want to compile the GNU Bash Shell(4.1) as the init program of the system. I built bash and installed it to the path /bin/, then linked /...
nut Cautious's user avatar
1 vote
0 answers
103 views

What is /dev/selinux?

Is there a device node called /dev/selinux Android 13 init crashes with the following [ 1.417333] (7)[1:init]selinux: SELinux: Loaded file_contexts [ 1.417341] (7)[1:init]selinux: [ 1....
Bret Joseph's user avatar
0 votes
1 answer
486 views

Can I call /sbin/init from init script

Let us say I have a custom init like this #!/bin/bash sleep infinity Which of these will load init #!/bin/bash /sbin/init sleep infinity #!/bin/bash exec /sbin/init sleep infinity I know that exec ...
Bret Joseph's user avatar
1 vote
1 answer
519 views

Alpine Linux in Raspberry Pi not activating swap partition on boot

Probably this is a really naïve question, but I can’t make this work by trying the methods I’ve found in the existing documentation or in other solutions. I have Alpine Linux installed on a Raspberry ...
user avatar
0 votes
1 answer
253 views

Who mounts /proc and /sys in GNU/Linux systems?

If you build a custom GNU/Linux system for an embedded device, do you need to execute mount -t proc proc /proc mount -t sysfs sysfs /sys somewhere in init process or is this done automatically by the ...
mrn's user avatar
  • 149
1 vote
1 answer
934 views

How to know the boot time (kernel + init) in Alpine using openRC?

I made a bit of research on the matter and also asked ChatGPT, but there doesn't seem to be a way to measure full boot time of an alpine distribution with OpenRC. Using dmesg, I can see the last ...
Abdellah Stands with Gaza's user avatar
4 votes
2 answers
8k views

Which user does systemd start services as?

I'd like to learn about how systemd starts services, specifically which user the service is started as, and I'd like to use Jenkins running on my Linux PC as an example. I know that init is pid 1, the ...
StoneThrow's user avatar
  • 1,787
0 votes
1 answer
314 views

Stop not called for init rc.d service

I have a very simple SysVinit service in /etc/rc.d: #!/bin/bash PIDFILE="/var/run/test.pid" status() { if [ -f "$PIDFILE" ]; then echo 'Service running' return 1 fi ...
Maestro's user avatar
  • 191
0 votes
1 answer
32 views

How can I configure shutdown, reboot etc. to display a message on an old (2.6) Linux?

I have an old embedded control system that still uses a 2.6 kernel and runs Debian 4. I am looking for a way to display a message whenever the superuser calls (interactively) reboot, shutdown, ...
jstarek's user avatar
  • 1,724
0 votes
0 answers
90 views

init script to move file and reboot

I need a tiny init script which get arguments from /proc/cmdline and then move or copy dirs or files passed to in via /proc/cmdline and reboot. Everything is fine, except /sbin/reboot does not work ...
Yaroslav Minieiev's user avatar
0 votes
1 answer
169 views

How to integrate C program with init file?

So I am working on building minimal os using busybox. What I want is I want to run my .net program from BIOS. But I am not sure linux will run .net program or not, so to clear my path I am using C ...
Abhishek Borse's user avatar
1 vote
1 answer
91 views

What packages in a systemd distro rely on it?

I am aware that the reason you can't install runit or openrc on a distro and expect it to work is that some packages and stuff rely on systemd. What exactly do they rely on? The systemctl command? ...
sef sf's user avatar
  • 72
0 votes
1 answer
143 views

kernel ignores append init=/bin/bash

qemu-system-x86_64 -m 2G -accel kvm -kernel kernel6.1 -append "init=/bin/bash" -initrd myinitrd.gz Supposed to run bash as init, but kernel still prints: [ 1.400577] Run /init as init ...
exebook's user avatar
  • 202
0 votes
1 answer
141 views

making an init: how exactly does the reboot command work?

I'm trying to write an init, but can't figure out the reboot\poweroff thing. apparently reboot is just a link to systemctl? (I'm using arch) So how does this work? init poweroff works and stuff, but ...
sef sf's user avatar
  • 72
0 votes
1 answer
26 views

I wanna develop an INIT- how to set up dev env

I wanna make an init, and so I'm gonna need to get a very basic system on a VM probably. What is the best way to go about doing that? I also saw that it might be possible doing this with a docker ...
sef sf's user avatar
  • 72
2 votes
1 answer
448 views

Who actually mounts the file system and creates directories like /bin, /dev, /etc

I have a really basic doubt, which part creates all these directories, where is this configuration of creating directories stored while installing a new OS? What is the order in which these ...
Vyom Yadav's user avatar
2 votes
1 answer
451 views

System with serial console, which system is responsible for flow control settings

I have a proprietary Linux system, with a proprietary init system, which uses a serial console. I lately noticed, that the xon/xoff flow control is active on this serial console, which poses the risk ...
Sascha's user avatar
  • 121
1 vote
0 answers
895 views

Inside a Docker container, `tini` should be proxying signals to my Java app, but it doesn't seem to be doing so

I'm using tini as my init process to allow me to launch a Java app via a shell script in a container and have my app get signals from Docker when the container is stopped. Given that the problem ...
CryptoFool's user avatar
1 vote
1 answer
293 views

Determine the library or libraries used by the /sbin/init and /bin/sh in FreeBSD

How to determine the library or libraries being used by the /sbin/init and the /bin/sh in FreeBSD? Is it dynamically linked or static?
ordinary_guy's user avatar
0 votes
2 answers
1k views

Require systemd service to be started before executing init.d script

I have a script in /etc/rc.d/init.d/ on a Red Hat 7 system that is provided by a vendor. This script is able to be started and stopped via systemctl, but it appears to not actually be a systemd unit ...
dcom-launch's user avatar
3 votes
0 answers
868 views

WSL service logging like journald

I am running a WSL instance on my machine which starts a bunch of services like atd. What I would like to have is to have an ability to lookup the logs of a specific service like I would do using ...
777moneymaker's user avatar
0 votes
1 answer
264 views

systemd integration

I was asked during an interview this ambiguous question, that I couldn't answer which one of this tools has not had functions integrated into systemd? udev consolekit sysvinit pam syslog
alex's user avatar
  • 1
0 votes
1 answer
580 views

ALSA and PulseAudio starting without being invoked by init system?

Forgive me if this is a noob question, however, I just installed Artix with OpenRC, and while following the guide on setting up ALSA with OpenRC from the gentoo wiki, I was told to add the alsasound ...
Zsargul's user avatar
  • 91
0 votes
2 answers
1k views

How to get the latest usb.ids when update-usbids no longer exists?

I had to move from Debian Jessie to Buster. The script that runs to create a small custom boot disc runs update-usbids to get the latest files to copy over to the build. However it now says update-...
user3161924's user avatar
2 votes
2 answers
4k views

Why oom_reaper when having vm.panic_on_oom = 1

From what I understand from its author : The OOM killer currently allows to kill only a single task in a good hope that the task will terminate in a reasonable time and frees up its memory. (…) It ...
MC68020's user avatar
  • 8,239
1 vote
0 answers
158 views

/sbin/init does not exist after removing duplicates with rmlint

So I executed rmlint to remove duplicates on my archlinux, and executed the script it generated. Then I reboot and got the message bailing out you are on your own. Good luck. And /sbin/init does ...
dahko37's user avatar
  • 11
0 votes
2 answers
1k views

Why can fprintf(stderr, ....) output to screen when stderr doesn't refer to a terminal device?

Given that a simple program: /* ttyname.c */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <errno.h> int main(int argc, char **...
Li-Guangda's user avatar
2 votes
0 answers
243 views

Why does foreground job ignore job control signals when Bash is running as PID 1?

When bash is invoked as pid 1 directly through the kernel option init=/bin/bash --login, it will issue something like this before prompting: bash: cannot set terminal process group (-1): Inappropriate ...
Li-Guangda's user avatar
0 votes
2 answers
328 views

Why do I have to statically link a c program if I want to use it as the init program for the kernel?

I'm learning about how Linux works and for that I'm watching Tutorial: Building the Simplest Possible Linux System by Rob Landley. He basically goes through some steps to build a minimal system and ...
m4l490n's user avatar
  • 175
1 vote
2 answers
4k views

How to load kernel modules for current hardware in init of minimal Busybox-based system

In a minimal Busybox-based Linux system, which commands must be invoked as part of the init script to ensure all kernel modules for the current hardware are loaded?
Axel Fontaine's user avatar
1 vote
0 answers
306 views

How do I initialize the framebuffer in my init executable?

I have a "Minimal Linux" experiment where I have to take a system as close as possible to the bare kernel and thus I need to write my own init. I know how to do the shutdown, reboot, and ...
Eric Silveira's user avatar
0 votes
2 answers
363 views

Command to reset the system to a state as close as possible to the state after a reboot?

Which commands should I run in a Linux / Ubuntu server to reset the currently-running system to a state as close as possible to the state after a reboot? (without actually rebooting!) I can imagine ...
Basj's user avatar
  • 2,549
1 vote
1 answer
3k views

switch_root: failed to execute /sbin/init: Too many levels of symbolic links

So, recently I was doing the Linux from scratch project and I had multiple terminals open, so I was continuing to make it, and by accident I typed the line in another terminal tab (root), and it ...
kalix's user avatar
  • 13
0 votes
1 answer
71 views

Are RC folders obsolete on Ubuntu?

I am learning Linux, using Ubuntu. I wanted to remove network management from one of the run levels. I had done this correctly before, but now, no matter how hard I try, I can not remove a script from ...
Mani Kamran's user avatar
0 votes
1 answer
288 views

Custom run level

I recall in the past creating a custom run (init) level. Has anyone else come across that? I'm wanting to have a run level invoked in specific conditions. I've searched through current documentation. ...
PJD's user avatar
  • 1
2 votes
1 answer
646 views

How does the Linux kernel know the computer architecture?

In start_kernel(), one of the first things the kernel does is run setup_arch(). setup_arch() is defined for every supported architecture, so it is passed a pointer to the appropriate command line. How ...
Ramsey Alsheikh's user avatar
3 votes
1 answer
395 views

Defunct process on every boot, if I don't kill it, it hangs during shutdown

Every time I boot my PC (Ubuntu 20.04.2 LTS), I have a defunct process: johan@johan-desktop:~$ ps -AF | grep qemu libvirt+ 1596 1 0 0 0 15 07:17 ? 00:00:00 [qemu-system-x86] &...
Johan B.W. de Vries's user avatar
0 votes
1 answer
14k views

systemd says "networking.service failed" but network is up

Normally, I run Gentoo with openrc init, but am installing a Debian 10 server and having some trouble understanding systems. The server boots via a custom dracut initrd which created a bonded network ...
Travis Osterman's user avatar
2 votes
2 answers
1k views

How can I mount /dev from C?

How can I mount /dev from C? I'm writing a simple init, and I know this sounds stupid but I would like to have /dev mounted to another folder. The manpages for mount() don't show dev as a supported ...
Mason M's user avatar
  • 33
0 votes
1 answer
244 views

What happens when I restart a service via systemctl or init

Im trying to understand the lifecycle of a process during the restart. For eg: If we issue the restart command It'll kill the process id remove or flush all the open files in the descriptors. Close ...
TheDataGuy's user avatar
0 votes
1 answer
137 views

Init script still running after boot

I created a 1 line shell script to send me some custom notifications, and it works as intended. I placed the script in /etc/init.d/, ran update-rc.d scan defaults. After reboot, the notifier script is ...
john doe's user avatar
  • 856
1 vote
1 answer
1k views

Dropping to initramfs shell

For many years now I've been an avid windows & mac user. Most recently, the growing love-affair between tech corporatists and government bureaucrats has convinced me to take the plunge into the ...
STYX's user avatar
  • 11

1
2 3 4 5
8