on boot     iptables blah --blah     iptables blah --blah  service myservice /system/bin/myarm64binary --config /path/to/conf.cfg     class main     user root   According to the documentation:      / init.rc is the most important. RC file. It is loaded by init process   at the time of initialization. It is mainly responsible for system   initialization. It will import / init.${ro.hardware}.rc, which is the   main. RC file provided by system-level core vendors.      When the mount_all statement is executed, the init process loads all   files in the /{system,vendor,odm}/etc/init/ directory, which will   serve Actions and Services when the file system is mounted.   Is there something I'm missing? service list does not list my app and iptables not appended. Even if I test-edit init.rc and import my .rc directly it still does nothing.
123752
I have an executable build from a ndk-build program. I want to run it on a rooted Android device. How much is the possibility that Android will kill my executable?  Using adb shell, I am able to execute my executable using following commands:  adb push executable /sdcard adb shell device:/ $ su device:/ # cd /system device:/system # mount -o rw,remount /system device:/system # mv /sdcard/executable . device:/system # ./executable   My requirement is to run this executable on device boot.  I have tried following:   Write ./executable in init.rc.   On reboot init.rc reset to its original contents. I figured out that Magisk done this.  Write commands in /system/etc/init/bootstat.rc   ./executable service custom /system/executable on boot  ./system/dhandler/diag_revealer    None of the above thing is working.
72567
I am developing a Nodejs application that the user interacts with via HTTP on localhost. There are practically no parameters and the daemon has virtually no dependencies and it just needs to be up by log-in time.  I would like to follow the idioms on each platform for start-up scripts, and that means Upstart on Ubuntu and systemd on Fedora.   Are there any good tutorials for writing systemd system files? Are there any 'best practices' to be aware of?   I have found these resources:        I am mostly looking for an API of sorts as a reference, as well as a basic format to follow.
27331
I looking into writing my own init.d scripts to control several services running on my Linux server. I came across an example online which contained:  nohup $EXEC_SCRIPT 0&lt;&amp;- &amp;&gt; $LOG_FILE &amp; echo $! &gt; $PID_FILE   From what I understand:   nohup Catches the hangup signal  $EXEC_SCRIPT is a variable containing the command to be run  0&lt;&amp;- &amp;&gt; Not come across this before $LOG_FILE similar to $EXEC_SCRIPT but contains the log file path &amp; starts logging to $LOG_FILE in the background? $! is the PID of the most last background command &gt; writes the result of $! to the $PID_FILE   I can work through it with this knowledge but the 0&lt;&amp;- &amp;&gt; is completely throwing me off. I don't like to include things that I don't at least partially understand first.
17781
I'm trying to install a service using InstallUtil.exe but invoked through Process.Start. Here's the code:  ProcessStartInfo startInfo = new ProcessStartInfo (m_strInstallUtil, strExePath); System.Diagnostics.Process.Start (startInfo);   where m_strInstallUtil is the fully qualified path and exe to "InstallUtil.exe" and strExePath is the fully qualified path/name to my service.  Running the command line syntax from an elevated command prompt works; running from my app (using the above code) does not. I assume I'm dealing with some process elevation issue, so how would I run my process in an elevated state? Do I need to look at ShellExecute for this?  This is all on Windows Vista. I am running the process in the VS2008 debugger elevated to admin privilege.  I also tried setting startInfo.Verb = "runas"; but it didn't seem to solve the problem.
52855
# ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. # see /usr/share/doc/bash/examples/startup-files for examples. # the files are located in the bash-doc package.  # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022  # if running bash if [ -n "$BASH_VERSION" ]; then     # include .bashrc if it exists     if [ -f "$HOME/.bashrc" ]; then     . "$HOME/.bashrc"     fi fi  # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then     PATH="$HOME/bin:$PATH" fi   Can anyone explain the contents of the ~/.profile file? So when you enter into the ~/.profile file what does all the writing mean?
91387
I have a Linux kernel module which I compiled dynamically. How is it added to startup? There are lot of .ko files in /lib/modules. How is priority set for loading these modules?
39337
I have a script that I would like to run as a service on my Ubuntu Server 11.04 headless box. That is, I want to have the correct files under /etc/init.d/ and to be able to control it via the service command.  Is there any guide available that will show me how to do this?
8009
I am setting up quota on my Linode server running Ubuntu 16.10, and I get the following error      Cannot stat() mounted device /dev/root: No such file or directory   So to fix this, I reached  for the fix which is done by adding   ln -s /dev/xvda /dev/root /etc/init.d/quota restart   to the /etc/rc.local. But Ubuntu 16.10 doesn't uses rc.local anymore instead uses . What is the alternative for rc.local, How can I run the above commands on startup?  Also I enabled the service using systemctl enable rc-local.service but it didn't work for me. Any lead would be appreciated.
53863
This works perfectly:  $ inotifywait --event create ~/foo Setting up watches. Watches established. /home/ron/foo/ CREATE bar   However, this just sits there when directory tun0 is created under /sys/devices/virtual/net.  $ inotifywait --event create /sys/devices/virtual/net Setting up watches. Watches established.   Since those folders are world readable, I'd expect inotifywait to work.  So, what am I doing wrong?  Thanks
113997
Possible Duplicate:          I have used both the dot command '.' and 'source' to reload a given rc file (typically to update my environment variables) but I am not sure if they are different and if one is preferred. What is the difference between the two ?
59515
I am PXE booting some Ubuntu machines in a cluster. All of a sudden my rc.local script has stopped working.  I've check the permission of /etc/rc.local:  -rwxr-xr-x 1 root root 1087 Jan 14 11:04 /etc/rc.local   I've checked that rc.local is symlinked in the following folders:  /etc/rc2.d  /etc/rc3.d /etc/rc4.d  /etc/rc5.d   They all symlink to /etc/init.d/rc.local.  I've tried to output echo lines from the script to /tmp/test.out but no luck. When I execute the rc.local script after the machines has booted, it works fine.  What can cause rc.local not to run?
54380
It's a question about user space applications, but hear me out!  Three "applications", so to speak, are required to boot a functional distribution of Linux:   Bootloader - For embedded typically that's U-Boot, although not a hard requirement. Kernel - That's pretty straightforward. Root Filesystem - Can't boot to a shell without it. Contains the filesystem the kernel boots to, and where init is called form.   My question is in regard to #3. If someone wanted to build an extremely minimal rootfs (for this question let's say no GUI, shell only), what files/programs are required to boot to a shell?
56356
Pretty simple question: In Linux, why does Python require the line   #!/usr/bin/python   at the start of a python file, since Windows doesn't?  What does it do? 'cause the description "Links to Python" is a bit vague...
114119
Where should I put systemd file for e.g. Nginx nginx.service or something like that on Ubuntu 16.04 ?
81323
I want to kill all running processes of a particular user from either a shell script or native code on a Linux system.  Do I have to read the /proc directory and look for these?  Any ideas? Is there a dynamic mapping of the pids under UIDs in Linux? Isn't this in the proc?  If not, then where is this list maintained? Should I read from it? Also where is the static list of all UIDs in the system so I can validate this this user exists and then proceed to kill all processes running under it?
81493
Installing a new system using a GPT partitioned disk dedicated to a single partition, ext4 formatted, extlinux (version 4.05) as bootloader, Ubuntu Core version 13.10 amd64 as rootfs, and Ubuntu linux-image-3.11.0-18-generic as kernel, and extlinux-update to generate bootloader configuration.  The result after reboot (still inside a KVM based virtual machine) is an (initramfs) prompt and these messages:  mount: can't read '/etc/fstab': No such file or directory mount: mounting /dev on /root/dev failed: No such file or directory mount: mounting /sys on /root/sys failed: No such file or directory mount: mounting /proc on /root/proc failed: No such file or directory The filesystem doesn't have requested /sbin/init. No init found. Try passing init= bootarg.   BusyBox is v1.20.2.  Regression:   the file system has been checked with fsck.ext4   Check for root existence  (initramfs) ls -l /dev/[hs]da* ls: /dev/[hs]da*: No such file or directory   Root boot argument  (initramfs) cat /proc/cmdline initrd=/boot/initrd.img-3.11.0-18-generic ro quiet BOOT_IMAGE=/boot/vmlinuz-3.11.0-18-generic   Check loaded modules  (initramfs) cat /proc/modules e1000 145368 0 - Live 0xffffffffa0000000   /boot folder content  $ sudo ls -l boot -rw------- 1 root root 3296162 Feb 18 22:37 System.map-3.11.0-18-generic -rw-r--r-- 1 root root 1007681 Feb 18 22:37 abi-3.11.0-18-generic -rw-r--r-- 1 root root  163258 Feb 18 22:37 config-3.11.0-18-generic drwxr-xr-x 2 root root    4096 Mar 17 20:13 extlinux -rw-r--r-- 1 root root 4995000 Mar 16 23:35 initrd.img-3.11.0-18-generic -rw------- 1 root root 5634192 Feb 18 22:37 vmlinuz-3.11.0-18-generic   How to make this system boot to the expected default bash prompt?
117286
I have a process that I need to run at startup. It is something that needs to stay running the entire time that the machine is on. As of now I am just typing the following into bash everything I start my server.  command -f argument &amp; disown   I know that I need to make an init script, but I had no idea how. After some research, it seems Ubuntu uses systemd (some references said Upstart, they aren't the same right?) as its init system. But all the guides I found online tell me to place my executable in /etc/init or /etc/init.d. Init is supposed to be a completely different init system.  Can someone please point me in the right direction? A sample systemd script or even an online guide would be a great help.