People who code: we want your input. Take the Survey

Questions tagged [rc]

An RC file is a script file containing startup instructions for an application program (or an entire operating system). These are usually a text file containing commands of the sort that might have been invoked manually once the system was running but are to be executed automatically each time the system starts up.

Filter by
Sorted by
Tagged with
15
votes
1answer
11k views

What is the difference between .exrc and .vimrc?

I know from experience that the ~/.exrc file can be used to configure vim. I also know that the ~/.vimrc file can be used for the same purpose. However, If I use .exrc to configure vim, this leads ...
9
votes
1answer
7k views

Why do we daemonize processes? [closed]

I've read and understood about how you create a daemon process, but from everything I read I never really understood why it needs to be done. I've read that we do the fork - setsid - fork to avoid ...
6
votes
1answer
6k views

zsh: is there a problem with always enabling extended glob?

I recetnly came across setopt extended_glob ...in order to enable extended globbing which allows for a number of cool wildcard additions, like excluding specific patterns, for example: ls ^foo* ......
6
votes
1answer
779 views

Change the direction of a new client appearance in Awesome Window Manager

In previous releases of Awesome WM new client title appeared to the right from the previous client. So, client titles were ordered from left to right by their order of appearance. In new releases of ...
6
votes
3answers
4k views

How to properly enable httpd with rcctl on OpenBSD so that it starts automatically?

On a OpenBSD machine running OpenBSD 6.2 amd64, httpd cannot be started by using rcctl: # rcctl start httpd httpd(failed) However, when started by just entering httpd, it works; but this is not the ...
6
votes
1answer
3k views

OpenBox Mouse binding for dragging window to screen edge

I am trying to edit the lxde-rc.xml file (in ~/.config/openbox) so I can implement Window snapping like in Microsoft Windows. When a window is dragged to the right edge of the screen, it maximizes to ...
5
votes
1answer
2k views

Run .zshrc when passing command via -c

I have a script that runs a command via zsh -c. However, when zsh runs, it doesn't appear to load ~/.zshrc. I understand a login shell flag exists, but even zsh -lc <command> doesn't seem to ...
5
votes
2answers
2k views

How can I customize $PROMPT_COMMAND without overwriting the default (if present)?

Mac's Terminal comes with a default PROMPT_COMMAND that checks the history and updates the current working directory (title of the tab): Add echo $PROMPT_COMMAND to the top of your .bash_profile and ...
5
votes
1answer
803 views

Stow doesn't use the “ignore” option given in the rc file

Summary --ignore=<regex> lines that I put in my .stowrc does not work. When running Stow, it says "Loading defaults from .stowrc", yet it has no effect. But passing the --ignore=<regex> ...
4
votes
3answers
497 views

Is it possible to have conditionals in /etc/rc.local?

Is it possible to have a conditional within /etc/rc.local? I've checked many Q&As and most people suggest running chmod +x on it, but my problem is different. It actually does work for me without ...
4
votes
2answers
3k views

How to check if vim is installed?

I want to know how to check whether a command is installed. Specifically, I want to alias vi to vim on all machines where vim is a valid command. And I want to keep my *rc files generic. But some ...
4
votes
1answer
3k views

How to properly use Gentoo Linux as a supplement to an existing distribution?

While I originally wanted to entirely replace the Linux distribution my NAS uses, I meanwhile came to the conclusion that it would be better to leave the existing system as unmodified as possible and ...
4
votes
1answer
2k views

Cannot trigger tmux script on boot

I have a tmux triggering script as mentioned below, running on Raspbian Wheezy 7.10: Step 1 #!/bin/bash # this script is called "sess" tmux new-session -d -s sess1 'sudo /home/pi/bin/myscript.py' ...
4
votes
1answer
681 views

Installing software the first time a system boots after CentOS installation

I have a custom text based CentOS 6.4 installation that installs the OS, then after the first boot I have a custom rc.local file that installs custom applications and prepares the system for our ...
4
votes
0answers
3k views

FreeBSD: How to start a python script as daemon?

I'm facing an issue with a python file that I'd like to start as a service. I named my service ocrserver and the script I want to start is in /home/administrator/ocr/ocrserver/init.py with some ...
3
votes
1answer
7k views

How can I kill a program started from rc.local when Ctrl-C doesn't work?

I was trying to create a program that runs at start-up that takes a picture every 10 seconds (In a infinite loop) on my raspberry pi but I discovered I had made a mistake but couldn't Ctrl+C out of it....
3
votes
2answers
10k views

What is the difference between rc, rc.local and rc.sysinit?

I tried to display the list of startup scripts for the current runlevel at bootup. I wrote the following code. rl=`runlevel | cut -d " " -f2` ls /etc/rc.d/rc$rl.d/S* | cut -d "/" -f5 sleep 10 It's ...
3
votes
2answers
1k views

Difference between rc.conf, loader.conf and static kernel linking in FreeBSD

I'm curious: What, exactly are the benefits to statically linking modules into the kernel rather than loading through rc.conf, etc? For example: To add Linux emulation, I could add linux_enable="...
3
votes
4answers
8k views

Fedora 27 not running rc.local when booting

I was trying to get the Shadowsocks server running automatically after booting, and I used the rc.local file, but it was not working. rc.localis now: /usr/local/bin/ssserver -c /etc/shadowsocks.json ...
3
votes
2answers
12k views

Why is rcS required after file system is mounted by the kernel?

I using embedded Linux, I have compiled the kernel without initramfs and kernel is booting fine. But It shows me rcS file is not found I have put it in /etc/init.d/rcS and my rcS file look like #!/...
3
votes
1answer
3k views

My .vimrc file disabled the copy/paste action using mouse right click!

Am using an open source .vimrc file from GitHub, but it is screwing up my default mouse right click, copy-paste actions. Whenever I do a right click, it enters into the visual mode and I am having a ...
3
votes
1answer
3k views

Automatically start an application with a modifed LD_PRELOAD?

I have an application that needs a modified LD_PRELOAD. I want to start the application using the originally provided rc script, so I can benefit from an automatically updated rc script on an update ...
3
votes
2answers
881 views

disable sudo password prompt for boot script

I've got raspbian installed and need to mount a cifs path after boot is completed. In fstab I got an entry for this with the noauto parameter. When using auto, boot hangs. So in raspbian, the file is ...
3
votes
1answer
123 views

FreeBSD sysrc to add comments

Is there a way to use FreeBSDs sysrc to add comments to the file that it’s modifying? For example, if I had an /etc/rc.conf with the standard stuff hostname=“FreeBSDMachine” ifconfig_em0=“DHCP” ...
3
votes
0answers
61 views

How to determine what commands a FreeBSD rc script runs

I'm having problems starting a service managed by rc. I can't see anything in /var/log that looks relevant, so I'd like to try running the command manually. I know I can read through the script in /...
2
votes
2answers
345 views

My ubuntu-server doesn't execute my gtk-based program at startup!

I have Ubuntu-server 16.04. Installed gtk3 and can execute my program manually by this command: ./img when I go to it's directory /home/m. But when I tried to add this line to my /etc/rc.local file: ...
2
votes
1answer
7k views

Windows Subsystem for Linux is unable to determine current runlevel

Issue Many apt-get installs are failing b/c the system can't determine current runlevel Background specs: $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu ...
2
votes
2answers
655 views

Separate bashrc file for ssh sessions to avoid Unison Errors

Recently my Unison started throwing up some strange error whenever I tried to sync between my laptop and my PC. I realized that I had added a line in bashrc that would print my pending tasks whenever ...
2
votes
1answer
751 views

.bashrc or .profile for busybox on windows

I have enough experience with scripting on *nix servers, but busybox on Windows I enjoy first. I installed busybox using scoop. When I run: ash echo $HOME I got -> C:/Users/RO # OK, this is dir ...
2
votes
1answer
3k views

Using ~/.dircolors in fish shell

I just recently switched to the fish shell from bash and I am having trouble sourcing my dircolors template file to get custom colors to appear for certain file extensions. In bash, I was sourcing a ...
2
votes
2answers
2k views

How to autostart KDM on boot in OpenBSD 6.0?

I have installed kde4 (via running # pkg_add kde4) on my OpenBSD 6.0 VM and I would like to automatically boot KDM on startup. I have followed the most applicable guide Google found me, but it didn't ...
2
votes
2answers
2k views

Less command change color of “~” and “(END)”?

How do I change the color of the "~" characters that go along the edge of a Less command output. And how to change the color "(END)" at the bottom?
2
votes
1answer
389 views

IPV6 aliases in rc.conf

I am currently running FreeBSD 12.0-RELEASE-p2, and I can't figure out how to create both IPV4 and IPV6 aliases for a loopback (lo1) interface using rc.conf on boot. Here is a snippet of my rc.conf: ...
2
votes
1answer
877 views

Shutdown script seems to be executed twice

I have a small backup bash script that I wrote for my computer at work. I have copied the script into /etc/rc0.d/ and called it K01backup so it is executed before anything else upon shutdown. It backs ...
2
votes
2answers
518 views

How to prepare a headless machine?

I'm currently preparing an SD-card for my Raspberry Pi, i.e. an ARM machine, while I'm sitting on a x86 one. Therefore I cannot simply chroot into it and run rc-update add sshd default. So, how else ...
2
votes
1answer
2k views

Launch a command at the end of Linux startup

I have a Raspberry without screen/keyboard/mouse that does nothing else than launching a radio stream at startup : mplayer http://95.81.146.2/fip/all/fiphautdebit.mp3 I have put this command at the ...
2
votes
1answer
283 views

local shutdown scripts (do's and don't's)

At work, I'm running linux, and use vagrant on a daily basis. What I find annoying is that the system often hangs when I reboot/shut down, if I forgot to vagrant halt any virtual boxes I may have ...
2
votes
1answer
138 views

Is there any database solution that can do master-master replication by default on OpenBSD?

There are many "built-in" softwares for OpenBSD, ex.: NTP, LDAP, RADIUS, etc., see all (?): https://github.com/openbsd/src/blob/master/etc/rc.conf in the rc.conf file. The question: Currently, ...
2
votes
2answers
2k views

Execute root command after a user starts the session

I'm trying to find how is possible to execute a root command when a user starts their session. I found that adding commands to this file /etc/rc.local should execute the commands after the boot, but ...
2
votes
0answers
50 views

Is there something like rc.local in systemd? [duplicate]

Back with system V init there was a script called rc.local where you could stuff commands that needed to be run during bootup, which would not fit to one particular service. Does systemd have a ...
2
votes
0answers
45 views

Run interactive script before reboot

CentOS VM. I got a script for updating firmware that I would like to run before each reboot. However, I want to get user confirmation before the script is actually run. I put the script in /etc/init....
2
votes
0answers
455 views

Debian Wheezy : problem installing .deb package that uses update-rc.d with dependency numbers

I'm trying to install a .deb file, written by us, on a new Debian Wheezy system. The .deb file was originally written for Lenny, so is fairly old. I've tracked down one point where the installation ...
2
votes
2answers
178 views

bricked my beaglebone with a bad rc script

I dropped a new script into /etc/init.d, and used update-rc.d to install it into the other rc#.d subdirectories. Unfortunately I made two stupid mistakes: The script runs a long-running command (...
1
vote
1answer
496 views

Add an SSH key on boot

I have a Git repo that is authenticated with an SSH key - the key is not the standard id_rsa. I can run: eval $(ssh-agent -s) ssh-add /home/forge/.ssh/otherkey Then git pull origin master This ...
1
vote
4answers
2k views

Openbox - multiple commands separated with & for one keypress

I am trying to configure Openbox's rc.xml file in order to manipulate my soundcards with one keypress. Because I have multiple sound cards on my system I have to manipulate multiple sinks at once so I ...
1
vote
1answer
1k views

How to automatically start Rescuetime on startup (tried crontab and rc.local)

I have installed rescuetime on debian 9. It requires the command rescuetime to be run in a terminal, this just keeps running rather than running and closing (it adds an icon into the tray at the ...
1
vote
1answer
9k views

Understanding rc.local and troubleshooting

I (new to linux) am attempting to add a command to the boot up that will execute an application. The application accepts parameters and has simple output of what it is doing. To troubleshoot it, how ...
1
vote
1answer
2k views

FreeBSD - best way to set console vidcontrol mode from boot without disrupting scrollback buffer info

My system uses vidcontrol to change video mode, and I'd like to set a tighter video mode from boottime, for all console windows/devices. man vidcontrol says to do this by editing it into rc or rc....
1
vote
1answer
6k views

How to automatically add keyfile and passphrase to ssh-agent?

Linux 4.4.0-34-generic #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux I use the script to start ssh-agent and start other script (which is using expect to sent passphrase ...
1
vote
2answers
598 views

Trouble update-rc.d remove'ing dnsmasq on Debian Stretch

Background: On my Debian Stretch machine at home, I've noticed my DNS lookup times are pretty slow, and have concluded that the culprit is dnsmasq - since if I take it down, name resolution becomes > ...