Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
4
answers
1068
views
How to determine whether a service was terminated (not running but it should)?
I've got some services in `/service/...` in a gentoo-based system and I'd like to monitor these services. I can check whether they are running or down using `svc-status` but how can I determine whether they are not running but they should? So they are stopped due to some error or were they terminate...
I've got some services in
/service/...
in a gentoo-based system and I'd like to monitor these services. I can check whether they are running or down using svc-status
but how can I determine whether they are not running but they should? So they are stopped due to some error or were they terminated. Is it possible at all?
The use case is that I have more instances of the same service but not all of them are running at the same time. So I'd like to get notified by my monitoring script whether, for example, 3 out of 8 instances are running only when I explicitly started 4 instances.
papaiatis
(231 rep)
Mar 16, 2016, 01:54 PM
• Last activity: Aug 11, 2024, 09:47 AM
0
votes
0
answers
154
views
daemontools no longer startable as service: Start request repeated too quickly
I've got two Raspberries. An old one running Raspbian/Debin 4.9.35+ and a new one, running 5.15.32. On the old one, I have daemontools working smoothly and starting MyService smoothly as well upon reboot: ``` $ systemctl status daemontools.service ● daemontools.service - Daemontools service supervis...
I've got two Raspberries. An old one running Raspbian/Debin 4.9.35+ and a new one, running 5.15.32.
On the old one, I have daemontools working smoothly and starting MyService smoothly as well upon reboot:
$ systemctl status daemontools.service
● daemontools.service - Daemontools service supervision
Loaded: loaded (/lib/systemd/system/daemontools.service; enabled)
Active: active (running) since Sa 2022-07-30 19:23:19 CEST; 21h ago
Main PID: 368 (svscanboot)
CGroup: /system.slice/daemontools.service
├─368 /bin/sh /usr/bin/svscanboot /etc/service/
├─379 svscan /etc/service
├─380 readproctitle service errors: .... "Morgens"=830 und "abends"=2127 31.07. 16:23:56 INFO - [eg-...
├─384 supervise myProg
└─386 java -Duser.timezone=Europe/Berlin -Dfile.encoding=UTF-8 -jar myProg....
On the new one I've installed daemontools with agt-get, but after that there is nothing running or prepared. So I've copied /lib/systemd/system/daemontools.service from the old to the new Pi.
[Unit]
Description=Daemontools service supervision
[Service]
ExecStart=/usr/bin/svscanboot /etc/service/
Restart=always
[Install]
WantedBy=multi-user.target
Then I "enabled" the service and started it and receive an error:
pi@jc04:~ $ systemctl status daemontools.service
● daemontools.service - Daemontools service supervision
Loaded: loaded (/lib/systemd/system/daemontools.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Sun 2022-07-31 16:08:34 CEST; 16min ago
Main PID: 1084 (code=exited, status=0/SUCCESS)
CPU: 43ms
Jul 31 16:08:34 jc04 systemd: daemontools.service: Scheduled restart job, restart counter is at 5.
Jul 31 16:08:34 jc04 systemd: Stopped Daemontools service supervision.
Jul 31 16:08:34 jc04 systemd: daemontools.service: Start request repeated too quickly.
Jul 31 16:08:34 jc04 systemd: daemontools.service: Failed with result 'start-limit-hit'.
Jul 31 16:08:34 jc04 systemd: Failed to start Daemontools service supervision.
Using journalctl brings the following:
journalctl -u daemontools.service
-- Journal begins at Mon 2022-04-04 14:17:02 CEST, ends at Sun 2022-07-31 16:29:31 CEST. --
Jul 31 16:02:34 jc04 systemd: Started Daemontools service supervision.
Jul 31 16:02:34 jc04 systemd: daemontools.service: Succeeded.
Jul 31 16:02:34 jc04 systemd: daemontools.service: Scheduled restart job, restart counter is at 1.
Jul 31 16:02:34 jc04 systemd: Stopped Daemontools service supervision.
Jul 31 16:02:34 jc04 systemd: Started Daemontools service supervision.
Jul 31 16:02:34 jc04 systemd: daemontools.service: Succeeded.
Jul 31 16:02:34 jc04 systemd: daemontools.service: Scheduled restart job, restart counter is at 2.
Jul 31 16:02:34 jc04 systemd: Stopped Daemontools service supervision.
Jul 31 16:02:35 jc04 systemd: Started Daemontools service supervision.
Jul 31 16:02:35 jc04 systemd: daemontools.service: Succeeded.
Jul 31 16:02:35 jc04 systemd: daemontools.service: Scheduled restart job, restart counter is at 3.
Jul 31 16:02:35 jc04 systemd: Stopped Daemontools service supervision.
Jul 31 16:02:35 jc04 systemd: Started Daemontools service supervision.
Jul 31 16:02:35 jc04 systemd: daemontools.service: Succeeded.
Jul 31 16:02:35 jc04 systemd: daemontools.service: Scheduled restart job, restart counter is at 4.
Jul 31 16:02:35 jc04 systemd: Stopped Daemontools service supervision.
Jul 31 16:02:35 jc04 systemd: Started Daemontools service supervision.
Jul 31 16:02:35 jc04 systemd: daemontools.service: Succeeded.
Jul 31 16:02:35 jc04 systemd: daemontools.service: Scheduled restart job, restart counter is at 5.
Jul 31 16:02:35 jc04 systemd: Stopped Daemontools service supervision.
Jul 31 16:02:35 jc04 systemd: daemontools.service: Start request repeated too quickly.
Jul 31 16:02:35 jc04 systemd: daemontools.service: Failed with result 'start-limit-hit'.
Jul 31 16:02:35 jc04 systemd: Failed to start Daemontools service supervision.
Looks to me, as if daemontools starts and immediately finishes and that for 5 times and then initd breaks the circle. Why does that happen on the new engine and why does the same construction work like a charm on the old one? PS: daemon-reload and egine reboot didn't chaneg anything.
Regards and Thank you!
fbstov
(9 rep)
Jul 31, 2022, 05:02 PM
• Last activity: Sep 28, 2022, 05:37 PM
3
votes
2
answers
3941
views
Possible to pass env vars into chpst without envdir?
I use runit to daemonize my web application, and I'm trying to see if I can have my process managed by `sv` not have to have a corresponding `envdir` for its environment variables. I wonder if I can just pass those vars directly into my call to `chpst`. This is the `run` file under `/etc/service/mya...
I use runit to daemonize my web application, and I'm trying to see if I can have my process managed by
sv
not have to have a corresponding envdir
for its environment variables. I wonder if I can just pass those vars directly into my call to chpst
. This is the run
file under /etc/service/myapp
:
#!/bin/sh
exec 2>&1
cd /var/www/myapp
# what it currently looks like
exec chpst -u www-data:www-data /var/www/myapp/myapp
# what I'd ideally like to be able to do
FOO=bar BAZ=qux exec chpst -u www-data:www-data /var/www/myapp/myapp
As I mentioned, chpst
also comes with a -e
option to pass a directly with environment variables to it, I could use that, but I'm trying to avoid it for simplicity (fewer things to maintain). Is that at all possible? Tips?
Alexandr Kurilin
(2481 rep)
Feb 23, 2015, 07:53 PM
• Last activity: Jun 18, 2020, 05:13 AM
1
votes
1
answers
432
views
How to Start a Service in a Specific Directory via Daemontools?
I am using [daemontools](https://cr.yp.to/daemontools.html) to start my application. In the run script, I have something like exec taskset -c 2 [absolute path to my application] But the problem is that one of the black box library my application expects it to run in a specific directory. Now my ques...
I am using [daemontools](https://cr.yp.to/daemontools.html) to start my application.
In the run script, I have something like
exec taskset -c 2 [absolute path to my application]
But the problem is that one of the black box library my application expects it to run in a specific directory.
Now my question is how I can run my application in a specific directory without creating a subshell.
Thanks.
HCSF
(223 rep)
Nov 8, 2018, 03:30 AM
• Last activity: Nov 8, 2018, 05:10 AM
1
votes
1
answers
1107
views
Autostart/restart program simply with daemontools in debian 9
For example make vlc start and play a video full screen on boot. After working this out here it is:
For example make vlc start and play a video full screen on boot. After working this out here it is:
Hayden Thring
(272 rep)
Apr 2, 2018, 08:31 PM
3
votes
3
answers
609
views
Are there any good tutorials for NetBSD and daemontools?
I'm looking for some good resources on running `daemontools` on a NetBSD box. I've installed the binary package via `pkg_add`, but I can't seem to find an `rc` script for starting, e.g., `svscan`. I'm mostly a Linux and FreeBSD user, and this is the sort of thing I would expect to find after an inst...
I'm looking for some good resources on running
daemontools
on a NetBSD box. I've installed the binary package via pkg_add
, but I can't seem to find an rc
script for starting, e.g., svscan
. I'm mostly a Linux and FreeBSD user, and this is the sort of thing I would expect to find after an install. Did I just look in the wrong place? Should I be building from source to find those sorts of extras? Is there a good guide somewhere that covers things like this? Thanks.
Hank Gay
(3639 rep)
Oct 14, 2010, 06:35 PM
• Last activity: Aug 20, 2017, 01:21 PM
0
votes
1
answers
421
views
How to run PostgreSQL as daemontools service?
1. svscanboot was ran and added to autostart 2. added script from article [http://thedjbway.b0llix.net/services/postgresql.html][1] to /service/postgres/run and change mode a+x,root owner 3. Add service: svc -u /service/postgres 4. Check svstat /service/postgres, script not ran [1]: http://thedjbway...
1. svscanboot was ran and added to autostart
2. added script from article http://thedjbway.b0llix.net/services/postgresql.html to /service/postgres/run and change mode a+x,root owner
3. Add service: svc -u /service/postgres
4. Check svstat /service/postgres, script not ran
shkiper
(115 rep)
Oct 4, 2016, 06:25 PM
• Last activity: Oct 5, 2016, 05:41 PM
-1
votes
1
answers
2019
views
Problem with start Daemontools services
I created directorys with structure: `/service/ /run` executed command: sudo svc -dx /service/* fail: svc: warning: unable to control /service/httpadapter: supervise not running What cause of problem?
I created directorys with structure:
/service//run
executed command:
sudo svc -dx /service/*
fail: svc: warning: unable to control /service/httpadapter: supervise not running
What cause of problem?
shkiper
(115 rep)
Sep 30, 2016, 01:32 PM
• Last activity: Oct 4, 2016, 06:30 PM
2
votes
1
answers
882
views
Node.js server with daemontools is constantly restarted
I want to run a Node.js server with daemontools on Debian (Jessie) but my script running under `supervise` is constantly restarted. This is the run script that I'm using (`/etc/service/node/run`): #!/bin/bash exec setuidgid nodeuser bash -c './node' The script executes the following script as user `...
I want to run a Node.js server with daemontools on Debian (Jessie) but my script running under
supervise
is constantly restarted. This is the run script that I'm using (/etc/service/node/run
):
#!/bin/bash
exec setuidgid nodeuser bash -c './node'
The script executes the following script as user nodeuser
, where I load NVM, change into my code directory, and execute the Node.js server:
#!/bin/bash
# Load NVM because we are in a non-interactive shell
export NVM_DIR="/home/nodeuser/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
# Run server
cd /path/to/code
exec node server.js
When I start the service with sudo svc -u /etc/service/node
, the process is restarted all the time and ps faux
shows the following process hierarchy (the depth of the hierarchy is always changing):
/bin/sh /usr/bin/svscanboot /etc/service/
\_ svscan /etc/service
\_ supervise node
\_ /bin/bash ./node
\_ /bin/bash ./node
\_ /bin/bash ./node
\_ /bin/bash ./node
\_ /bin/bash ./node
| \_ /bin/bash ./node
| \_ /bin/bash ./node
| | \_ /bin/bash ./node
| | \_ /bin/bash ./node
| \_ /bin/bash ./node
| \_ tail -n1
\_ /bin/bash ./node
\_ tail -n1
Do you have an idea what's going on there? When I execute the script manually with ./run
, the server starts as expected and shows its output in the console.
**EDIT**
I found out that the service works only after rebooting. Once I restart it with sudo svc -du /etc/service/node
, it behaves like described above.
chrisklaussner
(357 rep)
Oct 2, 2015, 06:12 PM
• Last activity: Aug 28, 2016, 06:23 PM
1
votes
2
answers
621
views
Is there a retry count setting for svscan?
I'm supervising a script with svscan which may run into errors and stuck there. When the script dies svscan restarts it right away but dies immediately. So it keeps restarting it. I don't seem to find any setting or configuration for svscan such as a retry count or something. Are you aware of anythi...
I'm supervising a script with svscan which may run into errors and stuck there. When the script dies svscan restarts it right away but dies immediately. So it keeps restarting it.
I don't seem to find any setting or configuration for svscan such as a retry count or something.
Are you aware of anything similar?
papaiatis
(231 rep)
Mar 22, 2016, 08:23 AM
• Last activity: Aug 10, 2016, 12:55 PM
3
votes
0
answers
920
views
Why does this pipe not end when the las process dies (zombie)?
I have a script run and monitored by svscan/supervise. When the last luces-hf/run: #!/bin/bash set -v export http_proxy=[redacted] curl -N -s https://[redacted] |\ grep --line-buffered "event" | http_proxy='' xargs -n 1 luces.sh It seems that when the script launches `luces.sh` and the script hangs...
I have a script run and monitored by svscan/supervise. When the last
luces-hf/run:
#!/bin/bash
set -v
export http_proxy=[redacted]
curl -N -s https://[redacted] |\
grep --line-buffered "event" | http_proxy='' xargs -n 1 luces.sh
It seems that when the script launches
luces.sh
and the script hangs and remains zombie, then the whole pipe remains running. I would like it to fail, so that the script finishes and gets restarted by supervise.
This is the process tree:
24788 ? Ss 0:00 /bin/sh /usr/bin/svscanboot
24790 ? S 0:01 \_ svscan /etc/service
24794 ? S 0:00 | \_ supervise luces-hf
29876 ? S 0:00 | | \_ /bin/bash ./run
29877 ? S 0:00 | | \_ curl -N -s https://[redacted][long request never endind. server sent events one line at a time]
29878 ? S 0:00 | | \_ grep --line-buffered event
29879 ? S 0:00 | | \_ xargs -n 1 luces.sh
5885 ? Z 0:00 | | \_ [luces.sh]
**EDIT** : luces.sh
does three http requests using curl
**EDIT** : strace output for the xargs command in the script:
execve("/usr/bin/xargs", ["xargs", "-n", "1", "luces.sh"], [/* 6 vars */]) = 0
brk(0) = 0x1d07000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fad73c49000
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=43357, ...}) = 0
mmap(NULL, 43357, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fad73c3e000
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\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\37\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1840928, ...}) = 0
mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fad73664000
mprotect(0x7fad7381f000, 2093056, PROT_NONE) = 0
mmap(0x7fad73a1e000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7fad73a1e000
mmap(0x7fad73a24000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fad73a24000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fad73c3d000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fad73c3b000
arch_prctl(ARCH_SET_FS, 0x7fad73c3b740) = 0
mprotect(0x7fad73a1e000, 16384, PROT_READ) = 0
mprotect(0x609000, 4096, PROT_READ) = 0
mprotect(0x7fad73c4b000, 4096, PROT_READ) = 0
munmap(0x7fad73c3e000, 43357) = 0
brk(0) = 0x1d07000
brk(0x1d28000) = 0x1d28000
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fad73c1a000
rt_sigaction(SIGCHLD, {SIG_DFL, [CHLD], SA_RESTORER|SA_RESTART, 0x7fad7369ad40}, {SIG_DFL, [], 0}, 8) = 0
fstat(0, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fad73c48000
read(0, "event: HF\n", 4096) = 10
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 16952
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16952
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16952, si_status=0, si_utime=0, si_stime=0} ---
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 16968
read(0, 0x7fad73c48000, 4096) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16968, si_status=0, si_utime=0, si_stime=0} ---
read(0, "event: HF\n", 4096) = 10
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16968
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 17023
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 17023
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17023, si_status=0, si_utime=0, si_stime=0} ---
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 17040
read(0, 0x7fad73c48000, 4096) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17040, si_status=0, si_utime=0, si_stime=0} ---
read(0, "event: HF\n", 4096) = 10
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 17040
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 17065
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 17065
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17065, si_status=0, si_utime=0, si_stime=0} ---
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 17087
read(0, 0x7fad73c48000, 4096) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17087, si_status=0, si_utime=0, si_stime=0} ---
read(0, "event: HF\n", 4096) = 10
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 17087
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 17127
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 17127
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17127, si_status=0, si_utime=0, si_stime=0} ---
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 17147
read(0, 0x7fad73c48000, 4096) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17147, si_status=0, si_utime=0, si_stime=0} ---
read(0, "event: HF\n", 4096) = 10
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 17147
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 17274
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 17274
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17274, si_status=0, si_utime=0, si_stime=0} ---
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fad73c3ba10) = 17293
read(0, 0x7fad73c48000, 4096) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17293, si_status=0, si_utime=0, si_stime=0} ---
marianov
(173 rep)
Sep 1, 2015, 01:39 PM
• Last activity: Sep 4, 2015, 02:24 PM
2
votes
1
answers
14040
views
How to install daemontools on ubuntu or debian from source
I am installing D.J.B.'s `daemontools` on an ubuntu 10.04 server (64 bit). (This question is about `daemontools`, which is a free and open software for managing UNIX services. It is not about 'DAEMON tools', which is a commercial software for disk images, running on windows.) I first installed the b...
I am installing D.J.B.'s
daemontools
on an ubuntu 10.04 server (64 bit).
(This question is about daemontools
, which is a free and open software for managing UNIX services. It is not about 'DAEMON tools', which is a commercial software for disk images, running on windows.)
I first installed the build-essential package and afterwards followed the instructions on http://cr.yp.to/daemontools/install.html 1:1, but it fails:
Script started on Sa 28 Apr 2012 21:41:34 CEST
root@daemontools1:/# mkdir -p /package
root@daemontools1:/# chmod 1755 /package
root@daemontools1:/# cd /package
root@daemontools1:/package# wget http://cr.yp.to/daemontools/daemontools-0.76.ta ^Mr.gz
--2012-04-28 21:42:10-- http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
Resolving cr.yp.to... 131.193.32.142, 80.101.159.118
Connecting to cr.yp.to|131.193.32.142|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 36975 (36K) [application/x-gzip]
Saving to: `daemontools-0.76.tar.gz'
^M 0% [ ] 0 --.-K/s ^M58% [=====================> $
2012-04-28 21:42:11 (125 KB/s) - `daemontools-0.76.tar.gz' saved [36975/36975]
root@daemontools1:/package# gunzip daemontools-0.76.tar
root@daemontools1:/package# tar -xpf daemontools-0.76.tar
root@daemontools1:/package# rm -f daemontools-0.76.tar
root@daemontools1:/package# cd admin/daemontools-0.76
root@daemontools1:/package/admin/daemontools-0.76#
root@daemontools1:/package/admin/daemontools-0.76#
root@daemontools1:/package/admin/daemontools-0.76# package/install
Linking ./src/* into ./compile...
Compiling everything in ./compile...
sh find-systype.sh > systype
rm -f compile
sh print-cc.sh > compile
chmod 555 compile
./compile byte_chr.c
./compile byte_copy.c
./compile byte_cr.c
./compile byte_diff.c
./compile byte_rchr.c
./compile fmt_uint.c
./compile fmt_uint0.c
./compile fmt_ulong.c
rm -f makelib
sh print-ar.sh > makelib
chmod 555 makelib
./compile scan_ulong.c
./compile str_chr.c
./compile str_diff.c
./compile str_len.c
./compile str_start.c
./makelib byte.a byte_chr.o byte_copy.o byte_cr.o byte_diff.o \
byte_rchr.o fmt_uint.o fmt_uint0.o fmt_ulong.o scan_ulong.o str_chr.o \
str_diff.o str_len.o str_start.o
rm -f choose
cat warn-auto.sh choose.sh \
| sed s}HOME}"head -1 home
"}g \
> choose
chmod 555 choose
./choose c trydrent direntry.h1 direntry.h2 > direntry.h
./compile envdir.c
rm -f load
sh print-ld.sh > load
chmod 555 load
./compile alloc.c
./compile alloc_re.c
./compile buffer.c
./compile buffer_0.c
./compile buffer_1.c
./compile buffer_2.c
./compile buffer_get.c
./compile buffer_put.c
./compile buffer_read.c
./compile buffer_write.c
./compile coe.c
./compile env.c
./compile error.c
./compile error_str.c
./compile fd_copy.c
./compile fd_move.c
./choose cl trymkffo hasmkffo.h1 hasmkffo.h2 > hasmkffo.h
./compile fifo.c
./choose cl tryflock hasflock.h1 hasflock.h2 > hasflock.h
./compile lock_ex.c
./compile lock_exnb.c
./compile ndelay_off.c
./compile ndelay_on.c
./compile open_append.c
./compile open_read.c
./compile open_trunc.c
./compile open_write.c
./compile openreadclose.c
./compile pathexec_env.c
./compile pathexec_run.c
pathexec_run.c: In function ‘pathexec_run’:
pathexec_run.c:18: warning: implicit declaration of function ‘execve’
./compile chkshsgr.c
chkshsgr.c: In function ‘main’:
chkshsgr.c:10: warning: passing argument 2 of ‘getgroups’ from incompatible pointer type
/usr/include/bits/unistd.h:266: note: expected ‘__gid_t *’ but argument is of type ‘short int *’
chkshsgr.c:10: warning: implicit declaration of function ‘setgroups’
./load chkshsgr
./chkshsgr || ( cat warn-shsgr; exit 1 )
./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
./compile prot.c
prot.c: In function ‘prot_gid’:
prot.c:13: warning: implicit declaration of function ‘setgroups’
prot.c:15: warning: implicit declaration of function ‘setgid’
prot.c: In function ‘prot_uid’:
prot.c:20: warning: implicit declaration of function ‘setuid’
./compile readclose.c
./compile seek_set.c
seek_set.c: In function ‘seek_set’:
seek_set.c:9: warning: implicit declaration of function ‘lseek’
./compile sgetopt.c
./compile sig.c
./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h
./compile sig_block.c
./choose cl trysgact hassgact.h1 hassgact.h2 > hassgact.h
./compile sig_catch.c
./compile sig_pause.c
./compile stralloc_cat.c
./compile stralloc_catb.c
./compile stralloc_cats.c
./compile stralloc_eady.c
./compile stralloc_opyb.c
./compile stralloc_opys.c
./compile stralloc_pend.c
./compile strerr_die.c
./compile strerr_sys.c
./compile subgetopt.c
./choose cl trywaitp haswaitp.h1 haswaitp.h2 > haswaitp.h
./compile wait_nohang.c
./compile wait_pid.c
./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \
buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \
coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o \
lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \
open_trunc.o open_write.o openreadclose.o pathexec_env.o \
pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \
sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o \
wait_pid.o
./load envdir unix.a byte.a
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/bin/ld: make: *** [envdir] Error 1
Copying commands into ./command...
cp: cannot stat `compile/svscan': No such file or directory
I also tried to do it on debian squeeze, the result is similar: http://pastebin.com/VNAWLU57
I know I can install daemontools from the ubuntu and also debian repository, but how do I compile it myself?
mit
(1513 rep)
Apr 28, 2012, 07:55 PM
• Last activity: Aug 9, 2014, 12:51 AM
5
votes
1
answers
6239
views
Daemontools multilog loses log line time information. How to fix it?
I am using [daemontools][1] to monitor a process and its output log. I am using [multilog][2] to write the logs to disk. The run script for the log is: #!/bin/bash PATH=/usr/local/bin:/usr/bin:/bin cd /usr/local/script_dir exec multilog t s16777215 n50 '!tai64nlocal' '!/bin/gzip' /var/log/script_log...
I am using daemontools to monitor a process and its output log. I am using multilog to write the logs to disk.
The run script for the log is:
#!/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
cd /usr/local/script_dir
exec multilog t s16777215 n50 '!tai64nlocal' '!/bin/gzip' /var/log/script_log
The process being monitored, also writes output to stderr. So in the run script for the process there is the following lines to redirect stderr to stdout:
exec 2>&1
exec ./my_process
However, while tailing the log file, I see hundreds of lines of output coming in bursts (the monitored process writes output every few seconds), and the timestamp on the log lines differs in sub-microsecond levels. I know from the nature of the process that time difference between the log lines is not so small. Clearly multilog is buffering output and then adding the timestamp when it is ready to write to file. I would like the timestamps to more closely reflect the time at which the line was output. How can this be fixed?
donatello
(375 rep)
Mar 15, 2013, 01:47 PM
• Last activity: Mar 23, 2013, 12:09 AM
3
votes
1
answers
913
views
How to run a job every 6 hours starting at 3:00 using runwhen
I try to make [runwhen][1] perform a job every 6 hours, starting at 3:00 in the morning. (How) Can this be done? [1]: http://code.dogmap.org/runwhen/
I try to make runwhen perform a job every 6 hours, starting at 3:00 in the morning.
(How) Can this be done?
Marcel
(1144 rep)
May 6, 2012, 09:38 PM
• Last activity: May 12, 2012, 11:24 PM
3
votes
1
answers
686
views
Why does the rc.status file set the LC_ALL locale
I am currently creating a daemon service and in order to leverage existing service functionality, the startup script sources from /etc/status. This causes a problem with our service because within the first line, the locale is set to POSIX: # Do _not_ be fooled by non POSIX locale LC_ALL=POSIX expor...
I am currently creating a daemon service and in order to leverage existing service functionality, the startup script sources from /etc/status.
This causes a problem with our service because within the first line, the locale is set to POSIX:
# Do _not_ be fooled by non POSIX locale
LC_ALL=POSIX
export LC_ALL
The problem is that the services which gets started from the script inherit this locale setting.
The simple fix around this would be to unset the locale prior to starting the child process. However, I do not know the implications of this. What are the consequences of re-setting the LC_ALL variable after sourcing from rc.status?
user6353
Apr 6, 2011, 11:35 PM
• Last activity: Apr 6, 2011, 11:48 PM
Showing page 1 of 15 total questions