Thursday, May 7, 2015

Howto compile Bernstein’s daemontools on Ubuntu 14.04.2 LTS

aokanx@aokanx-VirtualBox:~/Downloads/admin/daemontools-0.76$ ./package/install
Linking ./src/* into ./compile...
Compiling everything in ./compile...
sh > systype
rm -f compile
sh > compile
./load envdir unix.a byte.a
/usr/bin/ld: errno: TLS definition in /lib/x86_64-linux-gnu/ section .tbss mismatches non-TLS reference in envdir.o
/lib/x86_64-linux-gnu/ error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [envdir] Error 1

Add gcc parameter: -include /usr/include/errno.h to admin/daemontools-0.76/src/conf-cc

aokanx@aokanx-VirtualBox:~/Downloads/admin/daemontools-0.76$ sudo ./package/install
[sudo] password for aokanx:
Linking ./src/* into ./compile...
Compiling everything in ./compile...
make: Nothing to be done for `default'.
Copying commands into ./command...
Creating symlink daemontools -> daemontools-0.76...
Making command links in /command...
Making compatibility links in /usr/local/bin...
Creating /service...
Adding svscanboot to /etc/rc.local...
Reboot now to start svscan.

Startup settings:
aokanx@aokanx-VirtualBox:~/Downloads/admin/daemontools-0.76$ cat /etc/rc.local
#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

exit 0

csh -cf '/command/svscanboot &'

CentOS 7 uses systemd
Create a new file /etc/systemd/system/daemontools.service, with the startup code in it:
Description=daemontools Start supervise

ExecStart=/command/svscanboot /dev/ttyS0


Start the service:

systemctl start daemontools.service

Test that it is running:

systemctl status daemontools.service

Enable it to start at boot:

systemctl enable daemontools.service

No comments:

Post a Comment