Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

4 votes
1 answers
3920 views
Unknown runlevel on Ubuntu 14.04, services not starting on boot
I rent a VPS from a VPS company and run an Ubuntu 14.04 web server there. Recently it had to be suspended by my provider for a while. After the suspension period (1-2 days), the VPS boots, but cannot acquire any runlevels. root@vps:/# runlevel unknown This, in turn, means no Upstart services are sta...
I rent a VPS from a VPS company and run an Ubuntu 14.04 web server there. Recently it had to be suspended by my provider for a while. After the suspension period (1-2 days), the VPS boots, but cannot acquire any runlevels. root@vps:/# runlevel unknown This, in turn, means no Upstart services are starting on boot, as the "useful stuff" requires runlevel . I can start individual services manually with initctl, unless they have dependencies which the boot did not start automatically. I cannot find anything useful/understandable from logs. Please do ask if you want specific log entries and I can try to find them. The server is (was) running PHP7, Nginx, MySQL, Redis, Minecraft Server, Mumble Server. The server was operating fine (and survived multiple reboots) before the suspension period. Here is my initctl list after a fresh reboot: http://pastebin.com/fcfcnxBU . Please do ask for specific details as I'm not entirely sure where to look for them (e.g. log files, debug artifacts, files and directories, etc.). **EDIT**: some progress via tinkering: It seems the filesystem and/or network stack is not started correctly when booting. When I do the following: $ ifup --all $ initctl emit static-network-up $ initctl emit filesystem ... Ctrl-C to exit loop $ initctl emit local-filesystems Then I get $ runlevel >N 2 And my server services (at least most of them) are running normally. I'll check if there is a single command of these that makes the boot init sequence continue normally. EDIT2: - ifup --all brings up a venet0:0 which is tied to the VPS' public static IP. - emit static-network-up does nothing. - emit filesystem + Ctrl-C starts - rsyslog - ssh - minecraft-server - cron - xinetd - console - tty2 - upstart-file-bridge - mysql and stops - plymouth - plymouth-upstart-bridge - emit local-filesystems starts - avahi-daemon - systemd-logind - mountall.sh - dbus - networking and something called network-interface-security (network-interface/lo) start/running disappears.
ojrask (141 rep)
Jul 18, 2016, 09:45 PM • Last activity: Jun 26, 2025, 05:04 AM
3 votes
1 answers
2890 views
How can I have systemd execute a script only if a service was stopped via systemctl, but not execute if it crashed by itself?
What I am looking for, is the equivalent of the pre-stop stanza in upstart, for systemd
What I am looking for, is the equivalent of the pre-stop stanza in upstart, for systemd
Abhay (31 rep)
Apr 27, 2017, 08:30 PM • Last activity: Sep 10, 2023, 04:06 PM
1 votes
1 answers
1415 views
how to run a script on ubuntu shutdown when it needs network on
I have an upstart script that needs to run on reboot or shutdown, but it needs to access the network to post an http requests and wait for the replies, I tried start on starting rc and start on starting (rc and net-device-up IFACE=eth0) but no luck.
I have an upstart script that needs to run on reboot or shutdown, but it needs to access the network to post an http requests and wait for the replies, I tried start on starting rc and start on starting (rc and net-device-up IFACE=eth0) but no luck.
Oron
Feb 11, 2014, 12:57 PM • Last activity: Oct 20, 2022, 01:07 AM
6 votes
6 answers
776 views
How to disable graphical shell?
I have a Linux system (Ubuntu) running in a VM, but now I want to disable the graphical shell. Where in the startup process are the graphical components launched? Is it some run-level dependent config? Which config files must I edit to stop it?
I have a Linux system (Ubuntu) running in a VM, but now I want to disable the graphical shell. Where in the startup process are the graphical components launched? Is it some run-level dependent config? Which config files must I edit to stop it?
mydoghasworms (1429 rep)
Sep 2, 2011, 07:58 AM • Last activity: Jul 16, 2022, 01:01 AM
2 votes
2 answers
3713 views
What do +,- and ? symbols represent in `service --status-all`
What do +,- and ? symbols represent in `service --status-all` represent in Ubuntu 14.04. I am not able to understand it properly. I guess `+` here might mean delayed services which start after the system startup. Similarly, `-` would mean services running at startup. No idea about the `?` symbol. So...
What do +,- and ? symbols represent in service --status-all represent in Ubuntu 14.04. I am not able to understand it properly. I guess + here might mean delayed services which start after the system startup. Similarly, - would mean services running at startup. No idea about the ? symbol. Somebody please help me identifying symbols. SAMPLE_STARTUP PROCESS
Am_I_Helpful (721 rep)
Jan 16, 2015, 03:31 PM • Last activity: May 10, 2022, 06:46 PM
1 votes
0 answers
96 views
RemainAfterExit in Upstart
Is there an Upstart equivalent to systemd's RemainAfterExit? I have an upstart task that exec's a script that completes quickly when the task is started. However, I would still like that task to report as active so that I can subsequently 'stop' the task and have it execute a cleanup script. In syst...
Is there an Upstart equivalent to systemd's RemainAfterExit? I have an upstart task that exec's a script that completes quickly when the task is started. However, I would still like that task to report as active so that I can subsequently 'stop' the task and have it execute a cleanup script. In systemd, I would do the following:
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/local/bin/my_script.sh create %i
ExecStop=/usr/local/bin/my_script.sh delete %i
How would I do the same thing in Upstart?
Brandon E Taylor (91 rep)
Oct 7, 2021, 08:08 PM
15 votes
3 answers
58182 views
service to start on boot doesn't work with update-rc.d command
I have installed redis server on my Ubuntu based server, so I can start/stop/restart redis server. The redis_server.sh is already in the /etc/init.d. Now I want to make redis start on boot. I learned from a website that by working with the update_rc.d command, I can add / remove the service on boot....
I have installed redis server on my Ubuntu based server, so I can start/stop/restart redis server. The redis_server.sh is already in the /etc/init.d. Now I want to make redis start on boot. I learned from a website that by working with the update_rc.d command, I can add / remove the service on boot. I tried the update-rc.d to add startup on boot, which doesn't work: root@ip-172-31-4-108:/etc/init.d# update-rc.d redis-server defaults //System start/stop links for /etc/init.d/redis-server already exist. In addition, there are some services I don't want to startup on boot, so I tried: root@ip-172-31-4-108:/etc/init.d# update-rc.d reids_6379 remove Removing any system startup links for /etc/init.d/reids_6379 ... But when rebooting next time, I still see that service running on boot.
user824624 (253 rep)
Nov 28, 2013, 10:55 AM • Last activity: Jun 8, 2021, 02:05 PM
201 votes
6 answers
103494 views
What are the pros/cons of Upstart and systemd?
It appears [systemd][1] is the hot new [init][2] system on the block, same as [Upstart][3] was a few years ago. What are the pros/cons for each? Also, how does each compare to other init systems? [1]: http://freedesktop.org/wiki/Software/systemd [2]: http://en.wikipedia.org/wiki/Init [3]: http://ups...
It appears systemd is the hot new init system on the block, same as Upstart was a few years ago. What are the pros/cons for each? Also, how does each compare to other init systems?
tshepang (67482 rep)
Jan 14, 2011, 08:00 PM • Last activity: Mar 6, 2021, 08:22 AM
2 votes
2 answers
13590 views
How to use Upstart scripts on CentOS7?
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...
I need to create a file /etc/init/start_swift.conf with following commands: description "mount swift drives" start on runlevel stop on runlevel 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. How to create this type of upstart files in CentOS7?
Oleksandr (1179 rep)
May 16, 2016, 08:53 AM • Last activity: Feb 9, 2021, 08:47 AM
0 votes
1 answers
52 views
What is wrong with my upstart job file?
I wrote a little script for upstart and included a log function in the executable file, but there is no log output. When starting the program manually, it works fine. Here is the ```.conf``` file located in ```/etc/init/```: ``` description "upstart file for the program" start on startup stop on shu...
I wrote a little script for upstart and included a log function in the executable file, but there is no log output. When starting the program manually, it works fine.
Here is the
.conf
file located in
/etc/init/
:
description "upstart file for the program"

start on startup
stop on shutdown

respawn

exec /usr/local/bin/program
I am using Ubuntu 14.04 LTS with upstart 1.12.1.
Python Schlange (103 rep)
Dec 25, 2020, 06:57 PM • Last activity: Dec 26, 2020, 10:37 AM
0 votes
1 answers
1057 views
Ubuntu "service" command stuck, can't reload services
Using Ubuntu 16.04.6 LTS, it is not possible to call the `service` command to modify the status of any `/etc/init/` services. The command starts but is stuck in execution. The services themselves are running still running and stopping though, based on their own configuration (`start on`, etc.) Scrip...
Using Ubuntu 16.04.6 LTS, it is not possible to call the service command to modify the status of any /etc/init/ services. The command starts but is stuck in execution. The services themselves are running still running and stopping though, based on their own configuration (start on, etc.) Scripts that are in /etc/init.d can be interacted with. There's nothing in /var/log/syslog, and nothing special in service-specific logs (/var/log/upstart/.log). initctl -v reload-configuration command is also stuck and prints nothing. I checked the syntax of the init scripts that I know I added using init-checkconf, and it outputs the following :
DEBUG: upstart_path=/sbin/upstart
DEBUG: initctl_path=/sbin/initctl
DEBUG: Setting XDG_RUNTIME_DIR='/tmp/init-checkconf.fbn15XHMSG'
DEBUG: confdir=/tmp/init-checkconf.1ZAjdLCNnz
DEBUG: file=/etc/init/tiler.conf
DEBUG: job=tiler
DEBUG: upstart_out=/tmp/init-checkconf-upstart-output.KbilFI2A3x
DEBUG: upstart_cmd=/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.1ZAjdLCNnz
DEBUG: Upstart pid=32001
DEBUG: Joining Upstart session 'unix:abstract=/com/ubuntu/upstart-session/0/32001'
DEBUG: Waiting for Upstart to initialise (attempt 1)
DEBUG: Secondary Upstart (/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.1ZAjdLCNnz) running with PID 32001
File /etc/init/tiler.conf: syntax ok
DEBUG: Stopping secondary Upstart (running with PID 32001)
And with the nginx script, which is the default one :
DEBUG: upstart_path=/sbin/upstart
DEBUG: initctl_path=/sbin/initctl
DEBUG: Setting XDG_RUNTIME_DIR='/tmp/init-checkconf.bk34MF5r1W'
DEBUG: confdir=/tmp/init-checkconf.1aWnCVHKEp
DEBUG: file=/etc/init/nginx.conf
DEBUG: job=nginx
DEBUG: upstart_out=/tmp/init-checkconf-upstart-output.n7w9BHFOsL
DEBUG: upstart_cmd=/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.1aWnCVHKEp
DEBUG: Upstart pid=32107
DEBUG: Joining Upstart session 'unix:abstract=/com/ubuntu/upstart-session/0/32107'
DEBUG: Waiting for Upstart to initialise (attempt 1)
DEBUG: Secondary Upstart (/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.1aWnCVHKEp) running with PID 32107
File /etc/init/nginx.conf: syntax ok
DEBUG: Stopping secondary Upstart (running with PID 32107)
What could be the cause of this problem, and how to fix it ? Thanks for your time **P.S.** Here is the strace log when running service tiler restart
execve("/usr/sbin/service", ["service", "tiler", "restart"], [/* 19 vars */]) = 0
brk(NULL)                               = 0x55b3bcb00000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=61892, ...}) = 0
mmap(NULL, 61892, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fee7dfe1000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\t\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee7dfe0000
mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fee7da02000
mprotect(0x7fee7dbc2000, 2097152, PROT_NONE) = 0
mmap(0x7fee7ddc2000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7fee7ddc2000
mmap(0x7fee7ddc8000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fee7ddc8000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee7dfdf000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee7dfde000
arch_prctl(ARCH_SET_FS, 0x7fee7dfdf700) = 0
mprotect(0x7fee7ddc2000, 16384, PROT_READ) = 0
mprotect(0x55b3bc08e000, 8192, PROT_READ) = 0
mprotect(0x7fee7dff1000, 4096, PROT_READ) = 0
munmap(0x7fee7dfe1000, 61892)           = 0
getuid()                                = 0
getgid()                                = 0
getpid()                                = 5537
rt_sigaction(SIGCHLD, {0x55b3bbe82540, ~[RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, NULL, 8) = 0
geteuid()                               = 0
brk(NULL)                               = 0x55b3bcb00000
brk(0x55b3bcb21000)                     = 0x55b3bcb21000
getppid()                               = 5535
stat("/home/ubuntu", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/sbin/service", O_RDONLY)     = 3
fcntl(3, F_DUPFD, 10)                   = 10
close(3)                                = 0
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
geteuid()                               = 0
getegid()                               = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0x55b3bbe82540, ~[RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, NULL, 8) = 0
read(10, "#!/bin/sh\n\n#####################"..., 8192) = 8192
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5538
close(4)                                = 0
read(3, "service\n", 128)               = 8
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5538
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5538, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5538
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5539
close(4)                                = 0
read(3, "service\n", 128)               = 8
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5539
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5539, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5539
stat("/run/systemd/system", 0x7ffdc59d9e90) = -1 ENOENT (No such file or directory)
chdir("/")                              = 0
faccessat(AT_FDCWD, "/etc/init/tiler.conf", R_OK) = 0
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fcntl(1, F_DUPFD, 10)                   = 11
close(1)                                = 0
fcntl(11, F_SETFD, FD_CLOEXEC)          = 0
dup2(3, 1)                              = 1
close(3)                                = 0
stat("/usr/local/sbin/which", 0x7ffdc59d9fa0) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/which", 0x7ffdc59d9fa0) = -1 ENOENT (No such file or directory)
stat("/usr/sbin/which", 0x7ffdc59d9fa0) = -1 ENOENT (No such file or directory)
stat("/usr/bin/which", {st_mode=S_IFREG|0755, st_size=946, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5540
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5540
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5540, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5540
dup2(11, 1)                             = 1
close(11)                               = 0
stat("/usr/local/sbin/initctl", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/initctl", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/sbin/initctl", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/bin/initctl", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/sbin/initctl", {st_mode=S_IFREG|0755, st_size=214216, ...}) = 0
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5541
close(4)                                = 0
stat("/usr/local/sbin/grep", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/grep", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/sbin/grep", 0x7ffdc59da030)  = -1 ENOENT (No such file or directory)
stat("/usr/bin/grep", 0x7ffdc59da030)   = -1 ENOENT (No such file or directory)
stat("/sbin/grep", 0x7ffdc59da030)      = -1 ENOENT (No such file or directory)
stat("/bin/grep", {st_mode=S_IFREG|0755, st_size=211224, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5542
close(3)                                = 0
close(-1)                               = -1 EBADF (Bad file descriptor)
wait4(-1, 0x7ffdc59d9f5c, 0, NULL)      = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
rt_sigreturn({mask=[]})                 = -1 EINTR (Interrupted system call)
wait4(-1, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGINT}], 0, NULL) = 5542
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=5542, si_uid=0, si_status=SIGINT, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5542
wait4(-1, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGINT}], 0, NULL) = 5541
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=5541, si_uid=0, si_status=SIGINT, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5541
rt_sigprocmask(SIG_SETMASK, [], [], 8)  = 0
rt_sigaction(SIGINT, {SIG_DFL, [INT], SA_RESTORER|SA_RESTART, 0x7fee7da374c0}, {0x55b3bbe82540, ~[KILL STOP RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, 8) = 0
tgkill(5537, 5537, SIGINT)              = 0
--- SIGINT {si_signo=SIGINT, si_code=SI_TKILL, si_pid=5537, si_uid=0} ---
+++ killed by SIGINT +++
It is stuck on wait. Also, there's nothing in journalctl
Minege (21 rep)
Nov 30, 2020, 10:27 AM • Last activity: Dec 10, 2020, 05:44 PM
7 votes
5 answers
45939 views
How to start application after login on CentOS?
I am trying to start GUI application with upstart script on CentOS. I have test script located /etc/init/ folder. start on desktop-session-start stop on desktop-shutdown respawn script export DISPLAY=:0 sleep 5 exec /.1/Projects/UpstartTest/start.sh & end script start.sh scripts is running binary fi...
I am trying to start GUI application with upstart script on CentOS. I have test script located /etc/init/ folder. start on desktop-session-start stop on desktop-shutdown respawn script export DISPLAY=:0 sleep 5 exec /.1/Projects/UpstartTest/start.sh & end script start.sh scripts is running binary files for GUI application. After reboot my computer. When I typed: [root@mg-CentOS ~]# initctl status test test stop/waiting So my upstart is not runnig. When i type > initctl start test manually it works fine without any problem. How can I run this upstart script after user login (desktop started) ? I am trying to find detailed documents for CentOS for upstart but there is no.
goGud (233 rep)
Aug 6, 2014, 02:14 PM • Last activity: May 27, 2020, 08:32 AM
1 votes
0 answers
91 views
What's causing initctl stop to fail?
I have an upstart process which terminates all child processes during post-stop: ```post-stop exec killall my-process & exec sleep 10``` This works as expected, however I'm unsure of the following two cases: If the killall process isn't run as a background process: ```post-stop exec killall my-proce...
I have an upstart process which terminates all child processes during post-stop:
-stop exec killall my-process & exec sleep 10
This works as expected, however I'm unsure of the following two cases: If the killall process isn't run as a background process:
-stop exec killall my-process && exec sleep 10
Or if I remove the sleep process altogether:
-stop exec killall my-process
In these two scenarios if i run initctl stop, it returns the following error:
: Job failed while stopping
Why does the first example stop as expected, whilst the other two examples fail to stop properly?
DariusFontaine (111 rep)
Apr 11, 2020, 10:47 AM
6 votes
3 answers
10420 views
Making environment variables available for downstream processes started within an init.d script
This questions stems from @FrustratedWithFormsDesigner [comment][1]. How do I make `export` environment variables set within an init.d script available to downstream processes started within that same init.d script? In more detail, I am on an Amazon EC2 instance and using an init.d script to control...
This questions stems from @FrustratedWithFormsDesigner comment . How do I make export environment variables set within an init.d script available to downstream processes started within that same init.d script? In more detail, I am on an Amazon EC2 instance and using an init.d script to control my node.js server that is in turn controlled by nodemon which monitors for file changes and restarts node as needed. So in short, my init.d script starts nodemon which then starts node. Environment variables set with export within the init.d script seem to be available to nodemon, but unavailable to node. How do I make these environment variables available to node as well? Currently, only init.d is available in my Amazon EC2 instance so is this even possible with init.d scripts, and if not, is this possible with upstart or preferably systemd?
Marc A (203 rep)
Jun 5, 2016, 04:02 AM • Last activity: Aug 21, 2019, 07:49 PM
-4 votes
1 answers
357 views
Ubuntu 18.04 startup questions regarding runlevels and *.wants directories
1. Is Ubuntu 18.04 using [Upstart][1] or [systemd][2]? 2. I know with the directories named *Rc0.d* Rc1.d *Rc2.d* ......*Rc6.d*. we can control runlevels in Ubuntu 18.04. But what is the difference between what they do, and the `*.wants` directories? [1]: http://upstart.ubuntu.com/ [2]: https://wiki...
1. Is Ubuntu 18.04 using Upstart or systemd ? 2. I know with the directories named *Rc0.d* Rc1.d *Rc2.d* ......*Rc6.d*. we can control runlevels in Ubuntu 18.04. But what is the difference between what they do, and the *.wants directories?
Sami (31 rep)
May 30, 2019, 06:58 PM • Last activity: May 31, 2019, 08:14 PM
5 votes
2 answers
2775 views
How to set up OpenVPN and Transmission to start at boot on CentOS 6?
I'm trying to set up Transmission with OpenVPN on a headless server running a minimal install of CentOS 6.10, and ideally these would start when I boot the system. I'm able to get everything to run by following the steps [here](http://www.naspberrypi.com/openvpn.html) and [here](http://www.naspberry...
I'm trying to set up Transmission with OpenVPN on a headless server running a minimal install of CentOS 6.10, and ideally these would start when I boot the system. I'm able to get everything to run by following the steps [here](http://www.naspberrypi.com/openvpn.html) and [here](http://www.naspberrypi.com/openvpn-transmission.html) — but that only works when running the script (vpn.sh, as per the two tutorials) manually. That script looks like this: #!/bin/sh sudo openvpn --cd /etc/openvpn --config /etc/openvpn/conf.ovpn --script-security 2 --up /etc/openvpn/up.sh I might add that in addition to OpenVPN and Transmission, I also have [this Telegram bot](https://github.com/pyed/transmission-telegram) that should start after all else is up, so my up.sh file also has one more line at the end and looks like this: #!/bin/sh /etc/init.d/transmission-daemon stop /bin/sed s/IP_ADDRESS/$4/ /var/lib/transmission/.config/transmission/settings_template.json > /var/lib/transmission/.config/transmission/settings.json /etc/init.d/transmission-daemon start /etc/init.d/transmission-telegram start Ideally, I'd be able to do something a bit more like what [this post](https://askubuntu.com/q/583679) outlines, though I'm not particularly picky about whether all the traffic goes through the VPN or if only the torrent traffic does: 1. Start OpenVPN at boot (after networking is up); 2. If the VPN connection goes through, configure Transmission to run through it; 3. If that goes through, run Transmission (and the Telegram bot); 4. If at any time the VPN goes down, also bring Transmission (and the Telegram bot) down gracefully. I tried following the steps outlined in that post, and for some reason I just can't get the event transmission-vpn-up to happen — triggered by the route-up.sh script in the tutorial — and always get initctl: Event failed. I'm not able to emit the event either by following the steps in the post, nor by passing the contents of the script manually to the command line. route-up.sh, as per the post on Ask Ubuntu, looks like this: #! /bin/bash /sbin/initctl emit transmission-vpn-up VPN_GATEWAY=$route_vpn_gateway LOCAL_IP=$ifconfig_local If I pass the contents of down.sh to the command line, though, I get no such error: /sbin/initctl emit transmission-vpn-down Tried passing both with sudo and without it. Is there a simple way for me to set this whole thing up? Am I missing something in particular with emitting the transmission-vpn-up specified in the other tutorial on AU, y'know, given that it's a tutorial for Ubuntu and not CentOS? Alternatively, would it be easier to just make vpn.sh (the first chunk of code in this post) run at boot? It would be as neat or graceful if the VPN goes down, but it'd do the trick. --- **Quick Update:** [The tutorial on Ask Ubuntu I mentioned above](https://askubuntu.com/a/583680) , particularly in the /etc/init/transmission-up.conf is trying to use /usr/sbin/ufw, which I don't have in CentOS — hence the original Event failed error message. I temporarily commented out those bits, and now I don't have any error messages. However, even without any error messages and with the VPN up and running, it seems like something else is failing because Transmission never starts... any hints on where I could look?
Marcy (63 rep)
Apr 24, 2019, 11:16 AM • Last activity: May 6, 2019, 01:37 PM
6 votes
3 answers
6075 views
How do I start a screen session using an upstart job with a non privileged user?
I am trying to create an Upstart job that starts a new `screen` session on boot, in which I would like to automatically start a `java` executable. Here is the .conf file I am currently trying to get to work, although I have tried several others: description "Run the bungeecord jar" start on (local-f...
I am trying to create an Upstart job that starts a new screen session on boot, in which I would like to automatically start a java executable. Here is the .conf file I am currently trying to get to work, although I have tried several others: description "Run the bungeecord jar" start on (local-filesystems and net-device-up IFACE=eth0 and runlevel ) stop on runlevel exec start-stop-daemon --start -c ridog --exec /usr/bin/screen -- -dmUS BungeeCord java -server -XX:UseSSE=4 -XX:+UseCMSCompactAtFullCollection -XX:MaxPermSize=356m -XX:ParallelGCThreads=6 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:+UseCompressedOops -XX:+AggressiveOpts -Xmx256M -jar BungeeCord.jar pre-stop script screen -S BungeeCord -X foo "end^M" end script To my knowledge, the script seems to work fine, I can run sudo start bungeecord and get the intended result, however, restarting the machine does not work. Instead, I get this error in the /var/log/upstart/bungeecord.log: Cannot make directory '/var/run/screen': Permission denied I've looked up this error and the search results are obscure and inconclusive. I've tried running the command as root, this removes the error but still no screen session. I've tried different commands like this: su ridog -c "screen -dmS BungeeCord java -jar /home/ridog/BungeeCord/BungeeCord.jar"
Riley Tench (81 rep)
Jun 23, 2014, 10:20 PM • Last activity: Apr 6, 2019, 01:26 AM
1 votes
1 answers
1504 views
Systemd to upstart
I got a systemd service and I am still using Ubuntu 14.04 for various reasons. As you probably know ubuntu uses upstart and not systemd. Can you guys help me convert this systemd service to an upstart service ? [Unit] Description=Conan - dong sliders to MAX After=syslog.target network.target [Servic...
I got a systemd service and I am still using Ubuntu 14.04 for various reasons. As you probably know ubuntu uses upstart and not systemd. Can you guys help me convert this systemd service to an upstart service ? [Unit] Description=Conan - dong sliders to MAX After=syslog.target network.target [Service] ExecStart=/home/steam/exiles/start_conan.sh User=steam Type=simple Restart=on-failure RestartSec=42s [Install] WantedBy=multi-user.target
SaeSi (25 rep)
Mar 1, 2017, 07:39 AM • Last activity: Mar 18, 2019, 03:13 AM
1 votes
1 answers
2158 views
Ubuntu's main bootup only returns blank screen, systemd bootup works fine
I use Grub to boot between Ubuntu and Windows. The options are somewhat like 1. Ubuntu 2. Ubuntu (Recovery Mode) 3. Windows If I choose 1, it shows the Ubuntu logo, the little balls under it flowing. Then just a blank screen. I can't even get into a text terminal by pressing Ctrl - Alt - F1 . But if...
I use Grub to boot between Ubuntu and Windows. The options are somewhat like 1. Ubuntu 2. Ubuntu (Recovery Mode) 3. Windows If I choose 1, it shows the Ubuntu logo, the little balls under it flowing. Then just a blank screen. I can't even get into a text terminal by pressing Ctrl-Alt-F1. But if I choose 2, and then choose Ubuntu (systemd), everything works just fine. I log in, everything runs. I'm no Linux expert but I believe the only two differences is that Option 1 uses Upstart instead of Systemd and vice versa. Personally, I don't care which my system uses. I'm just trying to get my default choice to work again. Any thoughts?
JoshEmory (111 rep)
Sep 6, 2016, 07:49 PM • Last activity: Mar 10, 2019, 08:03 PM
2 votes
1 answers
1724 views
How to start GUI application with upstart?
I have an GUI application. I want to start this application automatically. And when it goes down or closed unexpectedly, I want to reopen this application. I tried to use upstart script, however although there is no problem about services with upstart, GUI application is not starting with upstart sc...
I have an GUI application. I want to start this application automatically. And when it goes down or closed unexpectedly, I want to reopen this application. I tried to use upstart script, however although there is no problem about services with upstart, GUI application is not starting with upstart script. It says cannot connect X server.. Should I add or change some settings to open with upstart or is there any way to open GUI application automatically when unexpected exit or shut down occurs (not just once after login I mean not with Startup) ? **EDIT : Here is my current step for upstart:** I am trying to start GUI application with upstart script on CentOS. I have test script located /etc/init/ folder. start on desktop-session-start stop on desktop-shutdown respawn script export DISPLAY=:0 sleep 5 exec /.1/Projects/UpstartTest/start.sh & end script start.sh scripts is running binary files for GUI application. After reboot my computer. When I typed: [root@mg-CentOS ~]# initctl status test test stop/waiting So my upstart is not runnig. When i type initctl start test manually it works fine without any problem. How can I run this upstart script after user login (desktop started) ?
goGud (233 rep)
Aug 6, 2014, 07:47 AM • Last activity: Mar 9, 2019, 02:06 PM
Showing page 1 of 20 total questions