date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,295,035,247,000 |
I was going through a tutorial on setting up a custom initramfs where it states:
The only thing that is missing is /init, the executable in the root of
the initramfs that is executed by the kernel once it is loaded.
Because sys-apps/busybox includes a fully functional shell, this means
you can write your /init ... |
init is not "spawned" (as a child process), but rather exec'd like this:
# Boot the real thing.
exec switch_root /mnt/root /sbin/init
exec replaces the entire process in place. The final init is still the first process (pid 1), even though it was preceded with those in the Initramfs.
The Initramfs /init, which is a B... | Can the init process be a shell script in Linux? |
1,295,035,247,000 |
In this question, the accepted answers states that
For example, /sbin/init uses glibc [the vulnerable lib], and restarting that without a reboot is non-trivial.
Now, non-trivial is engineer'ish for impossible, but I'm still curious:
Is it possible to restart init without restarting the whole system?
|
telinit u
will restart init without affecting the rest of the system.
| Restarting init without restarting the system |
1,295,035,247,000 |
I want to run one sysvinit script before another and figured out how to do that.
To make sure, this actually happens in the the order I like, I would like to see a list, in which order that happens.
I found sudo insserv --showall already, but can't make head or tail of it, since it lists init scripts multiple times.
H... |
There's some files in /etc/init.d/ directory:
$ ls -al /etc/init.d/ | grep -i depend
-rw-r--r-- 1 root root 2739 Feb 17 05:20 .depend.boot
-rw-r--r-- 1 root root 2221 Feb 17 05:20 .depend.start
-rw-r--r-- 1 root root 1855 Feb 17 05:20 .depend.stop
Whenever you run update-rc.d the files will change. .depend.b... | How to find out in which order /etc/init.d scripts are load on Debian? |
1,295,035,247,000 |
I'm stuck in the boot and can't open any terminal. When I try to boot my laptop it shows the following error:
Gave up waiting for root device. Common problems:
-Boot args (cat /proc/cmdline)
-Check rootdelay= (did the system wait long enough?)
-Missing modules (cat /proc/modules; ls /dev)
ALERT! UUID=718ed077-947d-... |
Your empty output from cat /proc/modules indicates you have no kernel modules loaded, so something has gone wrong with either initrd file generation when installing your current kernel, or with hardware detection as the kernel starts up.
You might try running modprobe ahci to try and force loading the standard AHCI SA... | Missing modules (cat /proc/modules; ls /dev) and UUID doesn't exist in BusyBox |
1,295,035,247,000 |
On multiple computers running Ubuntu 14.XX, I ran the command "killall init" as user, and was immediately logged out. I could log back in again without a problem. Why is this? What's going on behind the scenes?
|
On newer Upstart systems, a session init process is started when you login using the GUI. Since Ubuntu uses Upstart, there's an init process for your session. Test it out using pstree -ps $$ in a terminal:
$ pstree -ps $$
init(1)───lightdm(1741)───lightdm(9511)───init(9526)───/usr/bin/termin(9570)─┬─gnome-pty-helpe(97... | Why does running `killall init` as user log me out? |
1,295,035,247,000 |
I managed to create a small and fully functional live Linux CD which contains only kernel (compiled with default options) and BusyBox (compiled with default options + static, all applets present, including /sbin/init). I had no issues to create initrd and populate /dev, /proc and /sys and also I had no issues at all w... |
OK, I did a lot of extensive research and I found out what was wrong. Let's start one by one:
When we use initramfs boot scheme the first process which the kernel invokes is the /init script. The kernel will never try to execute /sbin/init directly.
/init is assigned process identifier 1. This is very important!
The... | Minimal Linux with kernel and BusyBox: /etc/inittab is ignored, only /init is executed |
1,295,035,247,000 |
What file in Ubuntu is equivalent to the /etc/inittab file in RedHat?
In RedHat the /etc/inittab file contains the settings related to the runlevel in which you want to boot Linux.
|
Ubuntu uses Upstart, an alternative to sysvinit, which works completely differently. The Upstart CookBook discusses runlevels and how to work with them.
Generally, though, the RedHat concept of runlevels isn't used on Debian or derivatives, including Ubuntu; they have only "single user" or "everything running", witho... | File in Ubuntu equivalent to /etc/inittab file in RedHat |
1,295,035,247,000 |
I found lots of good documentation for ubuntu's start-stop-daemon and there is a man page for a binary daemon.
But from what I can tell the canonical way to start a daemon in a rhel/centos script is to source /etc/init.d/functions then use the daemon() function. But I can't find any good examples or documentation.
Wh... |
The documentation and example you are looking for is located at /usr/share/doc/initscripts-*/sysvinitfiles on CentOS/RHEL. Here is the documentation for the daemon function specifically:
daemon [ --check ] [ --user ]
[+/-nicelevel] program [arguments] [&]
Starts a daemon, if it is not already running... | what is the canonical way to start a daemon in rhel/centos-6 init script? |
1,295,035,247,000 |
Visiting some forum online that discuss about Debian and Xubuntu, I saw some users that add this line in the signature field:
...With no systemd...
This line is showed with pride (it seems to me).
From Wikipedia:
systemd is a suite of system management daemons, libraries, and utilities designed as a central manag... |
No, it is neither dangerous nor bad for you. You have stumbled upon a little battle of the init wars. I will not get into this in detail but, briefly, the situation is as follows.
Linux has been using sysvinit for most of its lifetime. This is old and lacks features and the one thing pretty much everyone agrees on is ... | Is systemd "malicious"? [closed] |
1,295,035,247,000 |
I am editing a init.d script. The init.d script runs a utility script which then runs an process. From either bash scripts how would I make it launch the main process as a specific user and group?
|
The simplest way is to use the su(1) command, it has an option that allows you to run a command via the user's shell, example:
su foo -c ls
This will switch to the user foo and run the ls command. If the user you want to use does not have a valid shell (ie it's not in /etc/shells, like /bin/false or /sbin/nologin) yo... | Launch process as another user/group (in init.d script) |
1,295,035,247,000 |
Say I am writing my own init program running on a Linux kernel.
What happens when my init program exits with return value 0 ?
Additionally is the behaviour different if the return value is non-zero?
|
What happens when my init program exits with return value 0?
This code, from the find_child_reaper function in kernel/exit.c, is run:
panic("Attempted to kill init! exitcode=0x%08x\n",
father->signal->group_exit_code ?: father->exit_code);
And consequently this message appears on your console:
Kernel panic - no... | Linux kernel action upon init process exiting |
1,295,035,247,000 |
I just wonder why kill -9 0 ends my tty console session?
What exactly is PID 0, it is not listed on a ps aux?
|
killing 0 isn't killing the pid 0. Instead it is an option in kill to kill all processes in the current group. With your command you are killing everything in the process group ID (GID) of the shell that issued the kill command.
from the kill man page:
pid... Specify the list of processes that kill should signal.... | Why does "kill -9 0" end my console session? |
1,295,035,247,000 |
command init seems to be the first process running after each booting.
If I init in my Ubuntu Gnome terminal, will that restart my OS?
|
If you're not root (and you shouldn't normally be logging in as root), you'll just get a message:
bash$ init
init: Need to be root
if you are root, you can change the current run level of the system using init (it actually runs "telinit" to make the change).
bash$ sudo init
init: missing runlevel
Try `init --help' fo... | What will happen if I run the command init in my Ubuntu Gnome terminal? |
1,295,035,247,000 |
I am currently working on a project which needs to be added to inittab so that the program loads during startup.
The program that I am trying to start is a c# mono application. I have created a start script and if the start script is run manually the program launches fine. However, when I put it into inittab the prog... |
The problem is simple, you are using OpenSuse 12.1 which uses systemd instead of your classic System V boot system.
To install a new service place create following file in /etc/systemd/system/myprogname.service
[Unit]
Description=My progname service file
[Service]
ExecStart=/home/bits/MyProgram
[Install]
WantedBy=mu... | Add item to inittab on OpenSuse 12.1 |
1,295,035,247,000 |
I have configured the lines in /etc/inittab as follows:
# The default runlevel.
id:2:initdefault:
But after logging in the output of runlevel is as follows:
N 5
So why am I in runlevel 5 instaed of 2?
Note: As an additionaly info here is uname -a output for my system
Linux d3bi4n 3.16.0-4-amd64 #1 SMP Debian 3.16.... |
$ dpkg -S /sbin/init
systemd-sysv: /sbin/init
Your init system is Systemd, not SysVinit. /etc/inittab is a configuration file of SysVinit, it is not used by Systemd. I presume you have this file because this is a jessie system which was upgraded from an earlier jessie or from wheezy with SysVinit.
Systemd doesn't e... | Why is my Debian jessie always in runlevel 5? |
1,295,035,247,000 |
I never thought about this before, but I was wondering why they chose runlevel 2. Every other distro and OS I've used default to runlevel 3 (with the exception of AIX which also defaults to runlevel 2).
|
The Debian distribution (and hence Ubuntu, which is derived from it) does not define any differences between runlevels 2-5 as a matter of policy. It is up to the local system administrator to make use of runlevels as they see fit.
Since there is no difference between runlevels 2-5, a default runlevel 2 was chosen.
| Why does debian and ubuntu default to runlevel 2? |
1,295,035,247,000 |
I'm running Debian 8 x64 and still learning it. One of the confusing things I've come across repeatedly on Debian and Ubuntu systems is there appear to be two ways of running and managing services:
service
systemctl
I've read through the Debian page on systemd (systemctl) as well as questions such as How does system... |
The service command is a "compatibility" tool to help people migrate from sysvinit to systemd. It's a smart program that tries to work out your current init system and will call sysvinit, upstart or systemd calls as necessary.
Your question is a little "tell the future" in nature; today Debian allows different init s... | If systemd has replaced SystemV, why is it still there and who is running the show? |
1,295,035,247,000 |
I'm designing an app that will be deployed/installed to a linux machine (perhaps Archlinux, but could be any distro and in fact I would actually prefer something lightweight and inside the Debian family if at all possible). This machine will not be a "general purpose" or multiple application machine: it's sole purpos... |
I would strongly recommend Archlinux for this task. It manages to strike the delicate balance between installing very few "end-user" applications by default and still leaving a sensible system upon which you can build.
As for steps to take to accomplish your goal, after you have Arch installed, fine-tune what services... | Dedicated-purpose, single application linux boxes [duplicate] |
1,295,035,247,000 |
What I understand from runlevels is that in each level some programs have permission to be executed and some don't. runlevel 3 boots system into CLI and runlevel 5 starts the default GUI.
But I don't understand what do 0(shutdown) and 6(reboot) mean?(Start in shutdown/reboot mode?!). What happens If set initdefault to... |
If you start in these, the system will shut down/reboot as soon as it enters the runlevel. A runlevel is essentially just a way of specifying actions you want to take when you enter/leave a certain state, in that respect, once those runlevels are entered they execute programs that prepare the computer to shut down or ... | What happens if I set default system runlevel to 0 or 6? |
1,295,035,247,000 |
I was reading through all the things that are run during bootup and have seen that after mounting the rootfs, /sbin/fsck.ext4 is run and after that systemd is run. I was wondering where or how fsck is run, because I was searching for it in the kernel source code and couldn't find it and its not part of the init script... |
Edit 2: checked sources
I've found the ubuntu initramfs-tools sources. Here you can see clearly, the Begin: "Mounting root file system" message is printed first, but in the mount_root function fsck is run before the actual mounting. I have ommited some non-relevant code, just to indicate the order. (If you would inspe... | Where is fsck run? |
1,402,867,478,000 |
I have a an inittab file with the following entry:
console::askfirst:-/bin/ash
According to this Man page a '+' character in the process field means
init will not do utmp and wtmp accounting for that process.
However, it does not say anything about a '-' character. What does having the '-' character in the process ... |
The hyphen appears to be a Busybox-specific feature (as is "askfirst", which was how I found that you are using Busybox). The example inittab file says:
# /bin/sh invocations on selected ttys
#
# Note below that we prefix the shell commands with a "-" to indicate to the
# shell that it is supposed to be a login shell.... | inittab '-' character in process field |
1,402,867,478,000 |
After a clean install of Fedora 17 and distcc-server, I did a service distccd start, which completed successfully.
man service indicates that it would merely be running the distccd script at /etc/init.d/distccd, but that file doesn't exist. chkconfig also doesn't appear to know about distccd, which is confirmed by th... |
/etc/systemd is for user defined services. The default location for system defined services is /lib/systemd/system/. You can overwrite system defined services in /etc/systemd.
For more information about systemd either have a look at the fedora wiki page for systemd or have a look at the systemd documentation
| Why is a service being started if it isn't mentioned in /etc/init.d? |
1,402,867,478,000 |
I'm trying to run a CherryPy app on my NetBSD 5.1 box. To have it start automatically, I've added this line to my /etc/rc.local:
/bin/httpd &
When I boot the machine, some of the output of the Webserver starting is visible, right after the Starting sshd. message. None the less, I can't connect to my web-server.
I ca... |
The program will exit as soon as the rc.local script is finished. So, here's the complete procedure that doesn't require the program to understand any of the rc.d stuff:
Make the script executable (e.g. chmod a+x /usr/local/bin/httpd)
Add the following line to your /etc/rc.local:
nohup /usr/local/bin/httpd &
| How do I start my service at boot-time? |
1,402,867,478,000 |
The documentation I have read on systemd unit files states that unit files can be found in three locations on the filesystem:
/etc/systemd/system/: system unit files
/run/systemd/system/: runtime unit files
/lib/systemd/system/ (also sometimes /usr/lib/systemd/system/): default unit files for packages
I understand t... |
Historically, runtime unit files are intended for machine-generated units. They are supposed to override corresponding vendor units (if any), but are designed to allow user overrides, hence the defined precedence.
Nowadays I think they’ve largely been supplanted by transient units generated using the bus API; these do... | What are systemd runtime unit files for? |
1,402,867,478,000 |
From When the operating system shuts down, how does a service manager know that it should sends SIGTERM and SIGKILL to its services?
systemd IS BOTH the init and service manager
What is the difference between "init" and "service manager"?
I guess they are the same thing?
What is some example which is "the init" but ... |
init is (usually) the first process started by the system. It has a couple of special responsibilities, including (but not limited to:
Starting whatever other userspace processes are necessary to finish the boot up process.
Handling the final shutdown of the system (init is what ultimately tells the kernel to power ... | What is the difference between "init" and "service manager"? |
1,402,867,478,000 |
If I tell my system to go to run level 3 does that mean that it first runs through run level 0, 1, 2, and then finally runs through run level 3?
I thought the answer to this question was yes. But when I look on my RHEL 6 system I see that many of rcX.d directories contain same symbolic links.
In My /etc/rc.d/rc0.d/
[r... |
When you switch runlevel, the only things executed are the scripts in /etc/rc.d/rc${NEW_LEVEL}.d/.
This means that you are right: Every rc*.d directory needs to be able to handle all of the process/service changes when switching from another runlevel. So every rc directory contains a full set of scripts for reaching t... | When running to a run level does it execute previous run levels? |
1,402,867,478,000 |
I start a new process from GNOME Terminal and then this process fork a child.
But when I killed the parent process the orphaned process's parent id became something other than 1 which represent init --user pid.
When I do this in virtual terminals, the parent pid is 1 which represent init process.
How can I execute ne... |
I already answered a similar question a few months ago. So see that first for technical details. Here, I shall just show you how your situation is covered by that answer.
As I explained, I and other writers of various dæmon supervision utilities take advantage of how Linux now works, and what you are seeing is that ... | Orphan process's parent id is not 1 when parent process executed from GNOME Terminal |
1,402,867,478,000 |
init is the first task executed after kernel is loaded, right?
Then who is its owner.
also I can see [swapper/0] [swapper/1] ..... [swapper/7] having pid 0
PID PPID CPU TASK ST %MEM VSZ RSS COMM
0 0 0 c180b020 RU 0.0 0 0 [swapper/0]
0 2 1 f7550ca0 RU 0.0 0 ... |
init is a user-space process that always has PID=1 and PPID=0. It's the first user-space program spawned by the kernel once everything is ready (i.e. essential device drivers are initialised and the root filesystem is mounted). As the first process launched, it doesn't have a meaningful parent.
The other 'processes'... | init: is it a user thread or a kernel thread? |
1,402,867,478,000 |
The iniramfs is like a small os which mount root file system and hand over control to systemd. So, how does initramfs work internally? Is there any scripts executed to mount the root in linux?
|
After that initrd/initramfs (only historical difference) is extracted and mounted, it is the script /init that is run. Mostly it only mounts the real root with help of the modules from the initramfs.
And then it has to pivot/switch root to that new partition, a thing that is only possible as pid 1.
Here is a minimal ... | How does initramfs mount root filesystem? |
1,402,867,478,000 |
Reading What do the brackets around processes mean? I understand that the executable name is printed.
Linux ps man page:
Sometimes the process args will be unavailable; when this happens, ps will instead print the executable name in brackets.
However with ps -Awwo pid,comm,args I get:
PID COMMAND COMMAND
... |
Both the comm column and the first word of the args column in the ps output show the name of the executable program if everybody involved follows the default convention. However it is possible to have discrepancies for various reasons.
When a program starts, the command name as shown in the args column is chosen by th... | What does `init [2]` mean in the COMMAND column of ps? |
1,402,867,478,000 |
I'm trying to get a Qt application to launch immediately after booting up. When booted, the Linux image does nothing more than launch an X server and a terminal. It also has the cron daemon running in the background. Obviously, my Qt application needs the X server to be running to do anything.
I've seen a similar ques... |
Have a look at /etc/X11/xinit/xinitrc (this may be different places on different systems) to see what files it sources. Generally, this will have an if..elif..else structure, so that only one initialization file is read, with $HOME/.Xclients prioritized then /etc/X11/xinit/Xclients. That's almost certainly where the... | Starting Qt Application On Startup for Embedded Linux |
1,402,867,478,000 |
From: https://wiki.debian.org/LSBInitScripts
Add a block like this in the init.d script:
### BEGIN INIT INFO
# Provides: scriptname
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-... |
These are system facility names in Linux Standard Base. They're not treated like shell variables, they're just special names allowing init scripts to depend on certain system states.
In particular, $remote_fs and $syslog are defined as follows:
$remote_fs
all remote file systems are available. In some configurations,... | What are the variables $remote_fs and $syslog on SysVinit LSB header? |
1,402,867,478,000 |
I recently updated some of our machines to Fedora 17. I have noticed that there are some services that I can configure their runlevels using chkconfig, while others don't appear there at all, and can be configured using systemctl.
For example, there are the similar commands chkconfig network off and systemctl disable... |
From the fedora wiki page about systemd:
Does chkconfig command work with systemd?
Yes, for turning on/off services, compatibility has been provided both
ways. chkconfig has been modified to call systemctl when dealing with
systemd service files. Also systemctl automatically calls chkconfig
when dealing with a ... | How do systemd and chkconfig interact with respect to services and runlevels? |
1,402,867,478,000 |
I tried to remove some services from startup using various software like:
bum
sysv-rc-conf
rcconf
But... some services are still executed, like MySQL, OpenVPN, MongoDB etc.
I wonder if I am missing something, I did not understand what systemd is used for. Maybe these software are deprecated and should not be used an... |
Use # systemctl disable <your_service> to disable it.
| Startup services on Debian 9 |
1,402,867,478,000 |
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 mother of all processes in Linux, and in my case pid 1 belongs to systemd, which I can see from running top:
$ top
Tas... |
The default user that systemd uses for running system services is indeed root, but of course this customisable using the User option. From man 5 systemd.exec:
User=, Group=
Set the UNIX user or group that the processes are executed as, respectively. Takes a single
user or group name, or a numeric ID as argument. Fo... | Which user does systemd start services as? |
1,402,867,478,000 |
The init process exists as an ancestor of all of processes on a linux system. Does this process have any kind of IPC entry point ? Do other processes ever do IPC with init for any reason ?
|
Don't conflate processes and programs. There's one process #1, but it can be running one of a number of different programs.
If it is running the systemd program from the systemd package:
There is an internal systemd API accessible via D-Bus, that is not guaranteed stable and not intended to be used by things out... | Linux - IPC with init |
1,402,867,478,000 |
I am used to the old method of calling init 0 to shutdown. Bad, I know; but when I tried it on my new Arch install I get this:
# init 0
Excess Arguments
This confuses me because I thought systemd was supposed to support run levels? Looking at the man page, it mentions this:
For compatibility with SysV, if systemd is... |
For compatibility with SysV, […]systemd 234
[…] -SYSVINIT […]
You've built systemd without the compatibility option, so the compatibility behaviour described in the manual is not going to be present.
| Why does `init 0` result in "Excess Arguments" on Arch install? |
1,402,867,478,000 |
The book "How Linux Works" says the general shutdown procedure (independent of init system) is something like this:
init asks every process to shut down cleanly.
If a process doesn’t respond after a while, init kills it, first trying a TERM signal.
If the TERM signal doesn’t work, init uses the KILL signal on any str... |
You're right to be surprised: that order doesn't make sense. If a book presents it that way, it's sloppy and misleading.
Unmounting a filesystem, or mounting it read-only, writes all the data to the disk. When the umount command or mount -o remount,ro returns, all the data is written to the disk and sync has nothing l... | Shutdown procedure clarification |
1,402,867,478,000 |
I'm getting the following errors every 10-30 seconds on a virtual Red Hat Enterprise Linux 6.5 2 Server on Amazons EC2.
Sep 23 09:57:05 ServerName init: ttyS0 (/dev/ttyS0) main process (1612) terminated with status 1
Sep 23 09:57:05 ServerName init: ttyS0 (/dev/ttyS0) main process ended, respawning
Sep 23 09:57:05 S... |
A virtual Red Hat installation probably doesn't have any serial ports connected (which is what /dev/ttyS0 is: COM1 in DOS parlance), so trying to start agetty to listen to the serial port is doomed to fail. Find the line in /etc/inittab that contains agetty and ttyS0 and change
respawn to off.
EDIT: In case the syste... | ERROR: init: ttyS0 (/dev/ttyS0) main process (1612) terminated with status 1 |
1,402,867,478,000 |
I am running program using runit to run at startup. I want all the output by from the program that is run by runit to be logged to a file.
I have looked at svlogd but I cannot figure out how to get it running.
|
I cannot figure out how to get it running.
In the daemontools family world, log services are just services like any other. So you run svlogd with a run program just like you would run a "main" service with a run program.
The special things about "log" services are merely that:
The "log" service directory is locate... | How to log output to log file using runit |
1,402,867,478,000 |
I have a init script which is poorly designed because it does not conform to the Linux Standard Base Specifications
The following should have an exit code of 0 if running, and 3 if not running
service foo status; echo $?
However because of the way the script is designed, it always returns a 0.
I can not fix the scr... |
You are piping the grep output to wc and echo $? would return the exit code for wc and not grep.
You could easily circumvent the problem by using the -q option for grep:
/etc/init.d/foo status | /bin/grep -q "up and running"; echo $?
If the desired string is not found, grep would return with a non-zero exit code.
EDI... | How to trick an init script into returning 0 |
1,402,867,478,000 |
After reading this answer, I thought it would be funny to roll my own init on Python, so I wrote this in /init-python.
#!/usr/bin/python3
import os
import subprocess
# Make / writable!
subprocess.call(['/bin/mount', '-o', 'rw,remount', '/'])
# Became IPython (Now we're at it, get a good shell!)
os.execv('/usr/bin/ipyt... |
It can be done with reboot function (man 2 reboot).
import ctypes
libc = ctypes.cdll['libc.so.6']
RB_POWER_OFF = 0x4321fedc
RB_AUTOBOOT = 0x01234567
def shutdown():
libc.reboot(RB_POWER_OFF)
def reboot():
libc.reboot(RB_AUTOBOOT)
| Rolling your own init: How to shutdown/restart? |
1,402,867,478,000 |
If something prevents a Linux system from booting, it is common to see this message:
kernel panic - not syncing: [Error Message]
But what does "not syncing" mean? What exactly isn't syncing?
The only place I have seen sync before is the sync system call, ie., commit buffer cache to disk
|
You are correct in that it is referring to syncing the disks. If the kernel panics, there could be a multitude of reasons - including a software bug in file system code.
Syncing the disks could write corrupt data to the disks, such as if the panic was due to a bug in Ext4, for example - so the kernel plays it safe a... | What is a sync during kernel boot? |
1,402,867,478,000 |
I made a script that runs fine manually, but can't get it to run with the description in How to start a script file on boot?.
I have run update-rc.d -f minecraft.start defaults
This is what my /etc/init.d/minecraft.start is like
#!/bin/bash
case "$1" in
start)
screen -S minecraft.start /home/phirephoenix/minecra... |
I didn't remember screen having a daemon mode, apparently it does. Change the screen line for the following:
screen -dmS minecraft.start /home/phirephoenix/minecraft/bukkitserver/start_server.sh
The new parameter -dmS "Start as daemon: Screen session in detached mode.", which is the combination of -d -m and the -S th... | Make screen start as Daemon for a Minecraft server |
1,402,867,478,000 |
I know 'init' is first process that is started after the kernel is loaded, but there is an ambiguity for me. If it is a process it must have a binary executable file. However, the following shared object is compiled code that looks like an executable file, but there is no main function.
sardari@mint / $ file /sbin/ini... |
When a file compiled with -pie (Position Independent Executable) such as :
gcc -pie -fPIC hello.c
Then you have :
#file ./a.out
a.out: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x2afb7892000a1dc5b9010c591b75987188aa2d66, strippe... | /sbin/init is shared object? |
1,402,867,478,000 |
My OS is RHEL 6.2
I disable Ctrl+Alt+Del by changing in /etc/init/control-alt-del.conf the line
exec /sbin/shutdown -r now "Control-alt-del pressed"
by
exec /bin/true
I'll be testing it next Sunday.
My questions:
are there any daemons to restart?
I keep a copy on original /etc/init/control-alt-del.conf in /etc/init... |
change in /etc/init/control-alt-del.conf are taken immediatly.
I tested in ESX and physical hosts.
when I inserted
exec date > /var/log/cad.log
in /etc/init/control-alt-del.conf
and issue Ctrl-AltDel I get date in /var/log/cad.log.
So no need to reboot.
| How to disable ctrl-alt-del and /etc/init/control-alt-del.conf in Linux? |
1,402,867,478,000 |
I am wondering how I can run a daemon, in this case NTP, with custom parameters.
For example in my Ubuntu PC I observe that I've got ntpd running this way:
$ ps aux | grep ntpd
ntp 5936 ... 0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 119:127
You may notice that -g parameter.
But in my Gentoo PC I run the same c... |
Guessing from the Gentoo Wiki, editing NTPD_OPTS in /etc/conf.d/ntpd probably does the trick (regardless of the question if -g is advisable, no idea).
| How can I run a daemon with custom parameters |
1,402,867,478,000 |
When I boot my system, I can see the boot messages on my physical console tty1. After my X server has started, I can switch back to tty1 with CTRLALT+F1, and still see the output on the console. There is no getty running, because I have commented out the following line in /etc/inittab:
#1:2345:respawn:/sbin/getty 384... |
It's not possible and it has never been possible AFAIK.
This is well explained in the Linux keyboard and console HOWTO: the console display history uses the video memory witch is flushed when you switch console.
Upon changing virtual consoles, the screen content of the old VT is copied to kernel memory, and the scree... | cannot scroll back in console (tty1) |
1,402,867,478,000 |
I'm trying to understand the Linux init system.
I don't understand how there are three competing systems, yet the service command seems to work on all of them.
From the service commands man page:
service runs a System V init script or upstart job...
I'm using lubuntu 16.4 I think systemd is the default init system ... |
Some distributions have opted to include compatibility scripts so that old style commands still work. For example, on Debian 8.
root@matrix:~# which service
/usr/sbin/service
root@matrix:~# file /usr/sbin/service
/usr/sbin/service: POSIX shell script, ASCII text executable, with very long lines
root@matrix:~# grep u... | Why does using the service command work on a systemd distro? |
1,402,867,478,000 |
Supposedly I passed the kernel a parameter that it doesn't understand, for example blabla or eat=cake, what would the kernel do with these unknown parameters, the traditional case would be passing any unknown parameter to init, in case if the the Linux kernel starts with early user space (initramfs) would it pass it t... |
From the kernel documentation:
The kernel parses parameters from the kernel command line up to --;
if it doesn't recognize a parameter and it doesn't contain a ., the
parameter gets passed to init: parameters with = go into init's
environment, others are passed as command line arguments to init.
Everything af... | What does the Linux kernel do with unknown kernel parameters? |
1,402,867,478,000 |
I have looked and looked and none of the threads I have found are helping.
We have a tomcat startup script that we modified slightly for our needs. It works fine on Centos / redhat 6 boxes, but does not work on centos/redhat 5 boxes.
Here is the output of chkconfig --add tomcat:
$ chkconfig --add tomcat
service tomca... |
Replace "discription" by "description:" (typo and missing colon).
RHEL 5 needs "chkconfig:" and "description:", RHEL6 only "chkconfig:".
| chkconfig does not support my script |
1,402,867,478,000 |
my platform:
SOC = STM32H743 (ARMv7E-M | Cortex-M7)
Board = Waveshare CoreH7XXI
Linux Kernel = 5.8.10 (stable 2020-09-17)
initial defconfig file = stm32_defconfig
rootfs = built using busybox | busybox compiled using arm-linux-gnueabihf-gcc
I've created rootfs by following this guide.
my kernel cannot execute any f... |
the problem is that you are compiling it in a normal static elf format. you should compile it as an FDPIC-ELF executable (because you need a position independent executable (FDPIC) due to the lack of MMU).
FDPIC ELF is not ET_EXEC type. it is ET_DYN (it means it's shared) type and it is loaded by the Linux dynamic loa... | kernel cannot execute binaries (error -8) |
1,402,867,478,000 |
In my ps output:
root 1 0.0 0.0 225552 5316 ? Ss /lib/systemd/systemd --system --deserialize 19
message+ 572 0.0 0.0 51564 3076 ? Ss /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root 590 0.0 0.0 71084 2084 ? Ss /lib/systemd/sys... |
The init process is pid 1, and root most certainly doesn’t have to log in to start it. The other processes aren’t the init process.
The various per-user systemd processes manage each user’s services. These include user services (systemctl --user start ...), and a number of “per-user dæmons” (in GNOME, you’ll see Pulse... | Why is there a `systemd` process owned by each user that is logged in? |
1,470,427,386,000 |
I am running Debian testing. I have the following entry in my /etc/default/grub which was probably done a year or two before. Time-stamp says July 2015 but that may be when I made some other changes.
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 init=/lib/systemd/systemd"
Anyways, IIRC systemd has been the default sinc... |
Usually yes, but it depends on what you changed on the system.
Do dpkg -S /sbin/init to see what your system default is. If it is systemd-sysv (the default for clean Jessie upgrade) then systemd is default and you can safely remove it from and systemd will still run after reboot. If it is sysvinit-core however, you ne... | A way to know if systemd is indeed the default init |
1,470,427,386,000 |
Does Linux sends SIGCHLD to init (PID 1 process) when it inherits orphaned zombie processes (processes that have not been reaped by its original parent)?
|
Yep. I tested it. And you can see where this happens in the Linux code.
Test: Start a nested shell. From elsewhere, kill -s STOP the parent shell. Then kill -s KILL the child shell and then the parent.
Note:
If you try this inside gnome-terminal, for example, the reaper will not be PID 1. It will be a sub-reaper... | Does Linux sends `SIGCHLD` to `init` when it inherits orphaned zombie processes? |
1,470,427,386,000 |
I played around with a LSB init script under Debian Wheezy(init is from sysvinit package version 2.88dsf-41+deb7u1) for learning purposes. My script is following:
# cat /etc/init.d/test-script
#! /bin/sh
### BEGIN INIT INFO
# Provides: test
# Required-Start: $all
# Required-Stop: $all
# Default-Start: ... |
In addition to symlinks to /etc/rc<runlevel>.d/ directories, insserv adds a <script_name>: line to /etc/init.d/.depend.start file. My mistake was that I added <boot_facility>: line to /etc/init.d/.depend.start file. If we take the /etc/init.d/test-script as an example which has following LSB header:
### BEGIN INIT INF... | Which steps does "insserv" take to install an init(System-V) script? |
1,470,427,386,000 |
Why are some deamons run out of service and some out of initctl in Ubuntu? Do both tools do the same thing and it is just a matter of personal preference of the user what they will use?
E.g.
sudo service --status-all
vs
sudo initctl list
In my particular instance cron runs out of initctl, and ssh runs out of service... |
Some distributions are replacing the legacy System V to manage services. Ubuntu uses upstart while Fedora uses systemd. Generally speaking do the same, but systemd is more different that upstart respect System V. upstart is based in events, whereas systemd try to do aggressive parallelization and manage not only servi... | service vs. initctl in Ubuntu |
1,470,427,386,000 |
I recently acquired a laptop with a ssd and in order not to weigh too much on the ssd (which I was told had a limited number of write cycles), I decided to write a systemd unit file for setting up a swap and a filesystem (to use later with asd) respectively on devices zram0 and zram1.
I'm not really familiar with syst... |
I found what were my problems... the main one is that zram is not by default handeled by systemd.
As a consequence, there was no dev-zram0.device unit, so my services failed because of the unsatisfied dependencies.
The solution was to add
TAG+="systemd"
to my udev rules
There was another little error which was the ... | systemd : write a .service daemon for setting up swap and fs in zram |
1,470,427,386,000 |
When I switch from rulevel 5 to 3 (with init command) and I press CtrlAltF1 up to F7, I realize that now I’m on TTY1 instead of TTY7 and when I switch back to runlevel 5 I return back to TTY7. Why?
More generally, what’s the relationship among runlevels and virtual terminals (TTY)?
|
You can check here for the explanation of tty (teletype)
But summing up, tty 1-6 are for CLI terminal and tty7 up for GUI.
Check also here why tty7 is for X
Regarding the relationship for:
run-level 1 (single-user) you have only one tty
run-level 3 (multi-user text mode) you have by default from 1 to 6 and permi... | Relationship among runlevels and virtual terminals (TTY) |
1,470,427,386,000 |
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] <defunct>
johan 4109 4099 0 2260 2688 6 07:17 pts/1 00:00:00 grep --color=auto qemu
I can kill it jus... |
In the end this was resolved by upgrading to Ubuntu 22. I still have no idea what caused it.
| Defunct process on every boot, if I don't kill it, it hangs during shutdown |
1,470,427,386,000 |
I have a Raspberry PI running the standard Raspbian distribution. I have this little C program that I need to run at the very end of the shutdown sequence. All it does is send a couple of logical high pulses on a GIPO output to a power supply to tell it to cut the power to the Raspberry board. The shutdown script shou... |
The numbering requested is ignored by dependency based meta init systems. you have the wrong provides!. The critical clue is from another script. lets take a look at umountroot:
### BEGIN INIT INFO
# Provides: umountroot
# Required-Start:
# Required-Stop:
# Should-Stop: halt reboot kexec
# Default-Start... | Creating a shutdown only script with update-rc.d |
1,470,427,386,000 |
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 is this pointer initialized, and how and when does the kernel get the architecture of the computer?
|
A given kernel is built for a single architecture, so it has a single implementation of setup_arch. The generic start_kernel calls that, but it doesn’t pass an initialised pointer to the command line, it passes a pointer to a pointer to the command line, and it’s part of setup_arch’s job to initialise that pointer.
Fo... | How does the Linux kernel know the computer architecture? |
1,470,427,386,000 |
I noticed in somewhere that most of the Linux distro are based on Systemd instead of SysV init.
So I just want to know without installing and booting. Is there any possible way to find distro based on Systemd or SysV init ?
|
On distrowatch.com you can search for distributions using the init system as a criterion. You can even select "not systemd".
| How to determine a Linux distro is systemd or sysV init without installing or booting? |
1,470,427,386,000 |
I need to create a file /etc/init/start_swift.conf with following commands:
description "mount swift drives"
start on runlevel [234]
stop on runlevel [0156]
exec /opt/swift/bin/mount_devices
But the problem is that I even don't have the init directory. I have put start_swift.conf into /etc/init.d/ but it doesn't work... |
There are two answers for this question.
On CentOS 7 systemd is how you can run a service or script on start
You put a .service file under /etc/systemd/system, which can look like this:
; /etc/systemd/system/swift.service
[Unit]
Description=Swift
[Service]
Type=notify
ExecStart=myscript
[Install]
; Runlevel here:
... | How to use Upstart scripts on CentOS7? |
1,470,427,386,000 |
What if boot like this:
Pass INIT=/bin/sh(or /bin/bash) parameter to kernel, through GRUB command line or similar ways, then boot;
Once shell is loaded, exit immediately. Then the computer has no response to any key pressed.
I am quite curious about the STATUS of the system at this moment. As I have learned that init ... |
I'm surprised. My understanding was that terminating PID 1 causes a kernel panic. I can tell you what happened in that case.
Panic behaviour is configurable. With the default options, you will reach a loop that looks exactly as you say.
The delay function used is documented as being a "busy-wait". It is not expect... | Is system totally idle if boot with INIT=/bin/sh kernel parameter then quit immediately from shell? |
1,470,427,386,000 |
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 option.
|
The manpage for mount(2) only gives examples and mentions /proc/filesystems for an exhaustie list. This latter file lists devtmpfs which is what you are looking for.
The resulting C program would then be something like:
if (mount("-", "/.../dev", "devtmpfs", 0, NULL) != 0) perror("mount");
| How can I mount /dev from C? |
1,470,427,386,000 |
On an Amazon Linux (RHEL + CentOS fusion) OS server (this is actually an EC2 instance within a EMR cluster 4.5.0 AMI if that helps), we can see –
$ ls /etc/init.d/
acpid cloud-init-local instance-controller ntpd
…..
$ ls /etc/init/
control-alt-delete.conf had... |
Different daemons or services on this host are using either upstart or systemd.
I suspect your system is using upstart exclusively. What makes you think systemd is involved?
systemd and upstart init systems coexist together and both of them are active at any given time. Is this possible? Is this understanding corre... | Can systemd and upstart coexist together on a Unix system? |
1,470,427,386,000 |
Is there any difference between these two methods for application to start on boot? I need an application to start before a logon occurs and am questioning whether or not Ubuntu's Startup Application menu will accomplish this for me. Otherwise, I can put a startup script in the init.d but then have to find some way ... |
Yes, there's a big difference between those. What you can setup in the "Startup Applications" menu are all applications run after the user logs on into his/her desktop environment. And scripts under /etc/init.d are system startup scripts - they affect (almost) everything that is loaded from the moment your system fini... | Ubuntu 11.04 Startup Applicatation vs /etc/init.d |
1,470,427,386,000 |
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 directories are created? Are they created after /boot has been mounted by the kernel, by which part of the kernel?
|
The root filesystem is mounted first (readonly) at bootime, as your bootlog could tell you :
[kernel] [ 2.242830] VFS: Mounted root (ext4 filesystem) readonly on device 8:24.
It will then be remounted at init time :
[kernel] [ 2.266181] Run /sbin/init as init process
...
[kernel] [ 6.882156] EXT4-fs (sdb8): ... | Who actually mounts the file system and creates directories like /bin, /dev, /etc |
1,470,427,386,000 |
When I run podman run --init, I get
$> podman run --init -ti cp /sbin/init
Error: container-init binary not found on the host: stat /usr/libexec/podman/catatonit: no such file or directory
But I can easily verify that there is an init there,
$> podman run cp ls -- /sbin | grep init
init
telinit
What is catatonit? Wh... |
The error isn’t complaining about /sbin/init but about /usr/libexec/podman/catatonit, which points to /usr/libexec/catatonit/catatonit. The latter is provided by the catatonit package which is presumably not installed on your system (it’s only a weak dependency for podman).
On Fedora,
sudo dnf install catatonit
shoul... | podman run with --init gives me: Error: container-init binary not found on the host: stat /usr/libexec/podman/catatonit: no such file or directory |
1,470,427,386,000 |
I have a linux machine that I was accessing remotely and I made the mistake of doing #init 1 which turned off networking on the machine.
What is the easiest way to turn networking back on and/or get the machine out of single user mode?
I do have personnel that can access the machine locally if necessary.
|
You'll need the remote hands to get into the system via the console and run telinit 3 or telinit 5 if either of those were the runlevels you were using previously.
| How to turn off single user mode on a remote machine? |
1,470,427,386,000 |
I have a daemon/service (milter-regex), that is dying. I'm only using it temporarily (A few months), so don't care too much, but I want it to restart when it dies.
It is an init.d script. 'service milter-regex start' etc. The init script lives at /etc/init.d/milter-regex
I know if I have something in /etc/inittab, it ... |
Scripts in init.d don't get rerun automatically when the service crashes. If you want to do the minimum amount of work to make sure it runs, inittab may be your best bet. It's icky though, almost as icky as still running RHEL 4.
| /etc/init.d/script, or /etc/inittab - respawn on die |
1,470,427,386,000 |
Last night I broke my Arch. Now, when trying to boot, it says:
[0.595364] Failed to execute /init (error -13)
: can't log to /dev/tty5
starting pid 131, tty '': '/etc/init.d/rcS'
: can't log to /dev/tty5
can't run '/etc/init.d/rcS': No such file or directory
Please press Enter to activate this console. : can't log to... |
I have found the answer in /var/log/pacman.log. There were lots of lines saying "No space left on device" while trying to update mkinitcpio.
So I booted up a live stick and arch-chrooted into the arch system on my local ssd:
# loadkeys ... # change keyboard layout if needed
# mount /dev/sda1 /mnt
# arch-chroot /mnt
... | Failed to execute /init (error -13), can't run '/etc/init.d/rcS': No such file or directory |
1,470,427,386,000 |
I have the following myweb.service file
[Unit]
Description=myweb - A simple hello world program
After=bluetooth.service
[Service]
Type=simple
User=root
ExecStart=/usr/bin/docker run -p 2222:4343 manikanth/webapp
Restart=on-failure
[Install]
#WantedBy=multi-user.target
I purposefully disabled bluetooth.service and c... |
You are probably looking for the Requisite= option along with the After= option.
From the man page
Similar to Requires=. However, if the units listed here are not started already, they will not be started and the transaction will fail immediately.
Requires= does not work in this case is because the bluetooth.servic... | systemd After [unit] option not working |
1,470,427,386,000 |
I booted my system using in grub :
linux /boot/vmlinuz-4.5.0 root=/dev
initrd /boot/initrd-4.5.0
I set root to dev to specifically not get it to boot correctly.
Of course it falls back to the busybox stuffs; I've seen around the net that you can use mount and somehow start init. I searched around and found switch_root... |
You need to mount your root into which you will switch. I assume you already know how to do that. Basically it's just mkdir /newroot; mount -r /dev/something /newroot
Then you need to replace your currently running fallback shell. It's running with PID 1 (you can verify that with echo $$), and target init needs to get... | When in the fallback shell, how do you start init? |
1,470,427,386,000 |
Various older Linux distributions, which support System V type init scripts, require one to add LSB header to init script. For example a LSB header from /etc/init.d/sshd from OpenSUSE 11.4:
### BEGIN INIT INFO
# Provides: sshd
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: ... |
On debian it's update-rc.d which calls insserv (which is not usually run directly). On Suse it is probably chkconfig.
You can read about it here: suse 11
(note: this all changes in openSUSE 12, which has adopted systemd).
| Which utility reads LSB headers in System V style init scripts? |
1,470,427,386,000 |
I'm running Gentoo with the default SysV-style OpenRC init system. The boot time is short enough to not bother me. Is there any reason to try systemd?
|
Ther are multiple advantages of running systemd even after booting is done, some might interest you, some might not, a quick summary:
Service Monitoring: systemd can monitor services and restart them on failure while most clients will not even notice the service has restarted.
Clean management of services: in systemd... | Once the system has been started, is there any advantage in using systemd? |
1,470,427,386,000 |
I have a Debian Jessie build, and I want to add keyboard shutdown. I've tried the following, without any success:
Attempt 1
To /etc/inittab I added
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
I also tried
ca::ctrlaltdel:/sbin/shutdown -t1 -a -r now
Then I tried to create a file /etc/init/control-alt-delete.conf... |
sysvinit is deprecated in favor of systemd in Debian jessie. So you cannot change the system's behavior by editing /etc/inittab or /etc/init/*.conf.
When user presses Ctrl+Alt+DEL on the console, systemd invokes /lib/systemd/system/ctrl-alt-del.target which is by default a symlink to reboot.target in the same directo... | Shutdown with keyboard press doesn't work |
1,470,427,386,000 |
OpenSUSE 11.4 has rc<boot_facility> named symbolic links in /usr/bin/, /usr/sbin/ and /sbin/ directories:
# find / -type l -iname "rc*"
/etc/rc.d
/usr/bin/rcs2log
/usr/sbin/rcmysql
/usr/sbin/rcpcscd
/usr/sbin/rcsnmpd
/usr/sbin/rchal
/usr/sbin/rcntp
/usr/sbin/rcraw
/usr/sbin/rcfirewall
/usr/sbin/rcpowerfail
/usr/sbin/r... |
Isn't that to ease typing the service command for admin? Instead of typing something like /etc/init.d/svc reload, they just use rcsvc reload directly. At least some quick googling confirms that.
| Reason for rc<boot_facility> named symbolic links in OpenSUSE |
1,382,994,068,000 |
It's a fresh install of Sabayon Linux. I installed mysql (equo install dev-db/mysql), configured it (emerge --config ...), but it doesn't start using /etc/init.d script:
# /etc/init.d/mysql start
* WARNING: mysql is already starting
# /etc/init.d/mysql status
* You are attempting to run an openrc service on a
* sys... |
Some of services run by process manager such as : upstart, systemd, OpenRC (your case) , SysV and so on. if get ps ax |ergep -i mysql you'll find out myql is running,
Use the following documentation: OpenRC doc
| Sabayon - mysql (and other services) won't start |
1,382,994,068,000 |
I have a virtual server running Ubuntu 14.04 LTS x64 and I want to create a persistent process that restarts with the system and when it crashes.
To do that, I've added the following lines to the "inittab" in the etc-directory:
test:5:respawn:echo "HELLO TEST" > /test.log
sometestname:234:/var/path/to/process/myproces... |
You can use crontab. Crontab can start a process every minute, the process should check if it is already running and exit if it is. http://linux.die.net/man/1/crontab
| Create persistent process without inittab |
1,382,994,068,000 |
I know that PID 1 is init. Now I would like to knom, can I replace init process ID to another one and assign to PID 1 a new process. If yes how can I do that?
|
The first process that is started at boot time receives PID 1.
The first process that is started at boot time has a job: it has to start all other processes, directly or indirectly. All processes¹ are ultimately descendants of this, since apart from the kernel running a program at boot time the only way a process gets... | replacing PID 1 in linux [closed] |
1,382,994,068,000 |
I sometimes mistakenly shutdown the remote machine by using sudo init 0, so I wrote something like in one of my rc files:
alias sudo='sudo '
if [ $SSH_CLIENT ]; then
alias init 'echo Never use init when ssh'
fi
However although the rc files is executed, init still runs /sbin/init rather than the alias. And I don't ... |
Redefine sudo as a function:
sudo() if [ "$1" = init ] && [ -n "$SSH_CLIENT" ]; then
echo >&2 "Never use init when ssh"
return 1
else
command sudo "$@"
fi
If you want your aliases expanded after sudo, you can still add a
alias sudo='sudo '
it will still call our sudo function.
| Is there any way to disable shutdowning remote machine? |
1,382,994,068,000 |
I installed a minimal Debian system (stable) without GUI, switched to testing/jessie to be able to get the Cinnamon desktop, but X didn't start on boot. If I log in as myself at the CLI, I can type startx to launch the GUI, and I don't have any problems. So, I added the following to /etc/inittab:
# The default runleve... |
You only have the permission to start an X session with startx if you're logged in on a console. Remote users (for example) don't get this permission. When you run /bin/su -c /usr/bin/startx -l bateman from /etc/inittab, you don't get a console so starting the X server fails.
The normal way to get a GUI at run time is... | startx autologin does not run in /etc/inittab in after Debian Jessie update |
1,382,994,068,000 |
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?
|
Using file and ldd:
$ file /bin/sh
/bin/sh: ELF 64-bit LSB pie executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.1, FreeBSD-style, stripped
$ ldd /bin/sh
/bin/sh:
libedit.so.8 => /lib/libedit.so.8 (0x80108d000)
libc.so.7 => /lib/libc.so.7 (0x8... | Determine the library or libraries used by the /sbin/init and /bin/sh in FreeBSD |
1,382,994,068,000 |
When I do
ll /proc/1/exe
I get
lrwxrwxrwx. 1 root root 0 Oct 16 11:28 /proc/1/exe -> /usr/lib/systemd/systemd
Which means i am running systemd daemon not init.
But when I list
ll /etc/init.d/
I still get some services which are running by init (stripped output),
-rwxr-xr-x 1 root root 2269 Apr 22 2017 acpid*
... |
There is only systemd running in your system and it is starting all the services, including the ones defined in /etc/init.d.
For compatibility with older systems using traditional init (also known as "sysvinit" or "System V init"), systemd implements a mechanism by which it is able to start services using the traditio... | some process are started through init even i am using systemd |
1,382,994,068,000 |
I'm a little new to this so I apologize if my question is hard to follow.
I'm running Arch Linux, systemd as the init system, and I would like to boot into a plain TTY with no graphics. I've tried to disable the display manager I am currently using, as well as set the default target to multi-user, but I'm greeted with... |
Read through this helpful page of the Arch Wiki: Systemd Targets. Systemd targets are roughly equivalent to the old runlevels when everything used the init system. Change your target from 5(multi-user graphical) to 3(multi-user no graphics). This should drop you into a terminal login screen upon boot. If you want to g... | Booting Into a TTY with No Graphics? |
1,382,994,068,000 |
I have written my custom init (PID 1) script. In that script I have just mounted the necessary filesystems, but if I run ps aux the list is similar to below:
/ # ps aux
PID USER TIME COMMAND
1 root 0:00 /custom/init
2 root 0:00 [kthreadd]
3 root 0:00 [rcu_gp]
4 root 0:00 [rcu... |
They are started by the kernel; for example, the ksoftirqd threads are started in kernel/softirq.c.
| How are the kernel daemons running automatically? |
1,382,994,068,000 |
When I see status of sysstat is see the following,
● sysstat.service - Resets System Activity Logs
Loaded: loaded (/usr/lib/systemd/system/sysstat.service; enabled;
vendor preset: enabled)
Active: active (exited) since Wed 2018-11-28 11:46:45 EST; 4s ago
Process: 4159 ExecStart=/usr/lib64/sa/sa1 --boot (code=exited, ... |
Your assumption is wrong. sysstat is a "oneshot" type service, meaning it executes once and then it exits:
$ cat /usr/lib/systemd/system/sysstat.service
#... elided ...
[Service]
Type=oneshot
RemainAfterExit=yes
User=root
ExecStart=/usr/lib64/sa/sa1 --boot
#... elided ...
... which explains why there is no PID -- ... | Status of sysstat.service showing active(exited) |
1,382,994,068,000 |
I want that for a given number of system boots (say, 1 or 2 system boots), a message will appear.
I will store the message somewhere, maybe in a variable:
message='If you finished testing, make sure to remove the testing application.'!'
Notes:
I use Ubuntu server 16.04 and aim for a solution for GUI-less systems.
T... |
IMHO no purpose doing it "on boot" if there is noone to see it, so it is best made part of your login... You can call a script from your ~/.profile. The script can check if 1) the test application is still there and 2) some delay has passed since it last warned you (for instance by checking the time stamp of some file... | Print a message a given number of times, right after system boot (init) in a GUI-less system [duplicate] |
1,382,994,068,000 |
I wrote a daemon which watches for files in certain directory and if a new file is copied to this directory, then it is committed to SVN. New files appear in this directory only if remote devices copy files there over scp. Now I would like to create a System-V init script for this daemon in OpenSUSE 11.4. It's clear t... |
According to https://wiki.debian.org/LSBInitScripts in the section on Required-Stop
Normally you would include here the same facilities as for the
Required-Start keyword.
Having this script running before ssh starts isn't a problem like you suggested in the OP it just means this daemon will be waiting for files th... | "Required-Stop:" line in System-V type init script LSB header |
1,382,994,068,000 |
One argument I hear often about systemd is that it more adapted to current hardware needs, e.g. here
Computers changed so much that they often doesn’t even look like
computers. And their operating systems are very busy : GPS, wireless
networks, USB peripherals that come and go, tons of softwares and
services running ... |
Systemd reimplements many functionalities previously scattered over the whole OS (eg. in udev daemon), and is able to recognize that device was just plugged in or out.
At the same time, systemd holds all system services configuration: what need to be run, how to run it etc. And simply, it has all knowledge needed to s... | systemd in the era of hotplugable devices |
1,382,994,068,000 |
I am building a small embedded system for a x86_64 target, with a Linux kernel and an initramfs which contains a dynamically linked busybox.
I tried to install the needed libraries (libm.so.6, libc.so.6) into /lib and the linker ld-linux-x86-64.so.2 into /lib64( because the busybox binary request it at this place).
li... |
Read the manual of ld.so (the dynamic linker/loader). The actual search paths are mainly determined by /etc/ld.so.cache (which is compiled from /etc/ld.so.conf by ldconfig) or built-in paths in your ld.so binary. So check your platform configurations and how you built your glibc.
You can watch detailed activities of... | The linker does not find libraries in /lib |
1,382,994,068,000 |
Possible Duplicate:
Add item to inittab on OpenSuse 12.1
I have the following entry in my /etc/inittab (on OpenSuse 12.1):
gp:2345:respawn:/usr/local/gpm/bin/gpsrvd
Which won't execute no matter what I try to do.
comment it out
run init q
uncomment it
run init q again
Still it will not run!
I then run it manuall... |
OpenSuse 12.1 has switched to systemd which doesn't use /etc/inittab anymore but /etc/systemd/ with separate configuration files instead.
| Why process will not start in Inittab [duplicate] |
1,382,994,068,000 |
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 message [ 0.689037] Run /sbin/init as init process
But I want to know how much time it took to "complete" the init proces... |
First, install coreutils in order to get millisecond precision in alpine.
apk add coreutils
Then, we will create two services:
In /etc/init.d/boot-start
#!/sbin/openrc-run
description="Boot Start Service"
start() {
ebegin "Starting boot-start"
date +%s%3N > /var/boot-time.log
eend $?
}
And in /etc/init... | How to know the boot time (kernel + init) in Alpine using openRC? |
1,382,994,068,000 |
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? What is systemd-specific here?
|
For the most part, the desktop environments require the component activation logic provided by dbus, which now pretty much requires systemd, and there are a few features that depend on having a declarative configuration interface to activate and deactivate features.
For example, having a dropdown button that lets the ... | What packages in a systemd distro rely on it? |
1,382,994,068,000 |
I have found some chinese characters in one of a file on my linux mint 20.1
File - /proc/1/cmdline
Chinese Characters - 猯楢⽮湩瑩猀汰獡h
But when i open same file in terminal using less command, it shows : /sbin/init^@splash^@
Is this normal or is there anything to worry about in terms of security?
|
If you take the nul-terminated strings /sbin/init and splash, and convert them from the UCS-2LE (or UNICODELITTLE, or UCS-2-INTERNAL) encoding using iconv, you get
$ printf '/sbin/init\0splash\0' | iconv -f UCS-2LE
猯楢⽮湩瑩猀汰獡h
The output from less is more correct. The less utility shows nul bytes (\0) as ^@.
Conclusion... | Chinese Characters in One of a File |
1,382,994,068,000 |
I newly installed Fedora 30 on a machine then I installed Oracle Database 12c and restored a really big dump (took two days). Then, I installed samba server and shared a folder with that.
After that, I rebooted the system for the first time, but it didn't boot up saying:
[!!!!!!] Failed to start up manager
and nothi... |
OK, I found the answer myself.
After removing the quiet kernel option it showed some errors about the SELinux contexts.
The problem was the selinux kernel module.
I started the system with selinux=0 kernel option in grub to prevent selinux from loading and it worked!
| Fedora 30 can't boot: faild to start up manager |
1,382,994,068,000 |
I had a question earlier, it is tied into this, that one was looking for the proper procedure, this one is looking how to implement. If you need a backstory refer to My first question
I have a local device. I am the only one I want to have "local access". lets call this device charles.local
I want to have it, so whe... |
I don't have enough points to comment, but there's some chance this might also answer your question.
If I'm understanding you correctly, you want to allow local user logins, and once a user is logged in, spin up a new VM from scratch and auto-configure a user session of the same name? That could get pretty hair very q... | Setting up VM login instead of Local login [closed] |
1,382,994,068,000 |
I'm using Amazon Linux. I just Apache via yum, however, I can't get it to automatically start when I reboot my server, despite the fact it starts on the command line ...
[myuser@mymachine ~]$ sudo service httpd start
[sudo] password for myuser:
Starting httpd: httpd: apr_sockaddr_info_get() failed for mymachine
httpd... |
[myuser@mymachine ~]$ ls -al /etc/rc3.d/*httpd*
lrwxrwxrwx 1 root root 15 Oct 18 22:03 /etc/rc3.d/K15httpd -> ../init.d/httpd
That is your problem. Script that start with K, which stands for kill, in /etc/rc3.d will not start at boot time, scripts that start with S will.
If you do:
[myuser@mymachine ~]$ mv /etc/rc3.d... | Why isn't my Apache server starting automatically wnen I reboot my server? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.