Shortened daemon's name

This commit is contained in:
Maxim Biro 2014-01-25 21:00:31 -05:00
parent 4782a8475a
commit 553472442f
5 changed files with 30 additions and 29 deletions

View File

@ -1,17 +1,17 @@
if BUILD_DHT_BOOTSTRAP_DAEMON if BUILD_DHT_BOOTSTRAP_DAEMON
noinst_PROGRAMS += tox_dht_bootstrap_server_daemon noinst_PROGRAMS += tox_bootstrap_daemon
tox_dht_bootstrap_server_daemon_SOURCES = \ tox_bootstrap_daemon_SOURCES = \
../other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c ../other/bootstrap_serverdaemon/tox_bootstrap_daemon.c
tox_dht_bootstrap_server_daemon_CFLAGS = \ tox_bootstrap_daemon_CFLAGS = \
-I$(top_srcdir)/other/bootstrap_serverdaemon \ -I$(top_srcdir)/other/bootstrap_serverdaemon \
$(LIBSODIUM_CFLAGS) \ $(LIBSODIUM_CFLAGS) \
$(NACL_CFLAGS) \ $(NACL_CFLAGS) \
$(LIBCONFIG_CFLAGS) $(LIBCONFIG_CFLAGS)
tox_dht_bootstrap_server_daemon_LDADD = \ tox_bootstrap_daemon_LDADD = \
$(LIBSODIUM_LDFLAGS) \ $(LIBSODIUM_LDFLAGS) \
$(NACL_LDFLAGS) \ $(NACL_LDFLAGS) \
libtoxcore.la \ libtoxcore.la \
@ -23,5 +23,5 @@ endif
EXTRA_DIST += \ EXTRA_DIST += \
$(top_srcdir)/other/bootstrap_serverdaemon/conf \ $(top_srcdir)/other/bootstrap_serverdaemon/conf \
$(top_srcdir)/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.sh $(top_srcdir)/other/bootstrap_serverdaemon/tox_bootstrap_daemon.sh

View File

@ -2,44 +2,44 @@
The following commands are to be executed as root: The following commands are to be executed as root:
1. In `tox_dht_bootstrap_server_daemon.sh` file change: 1. In `tox_bootstrap_daemon.sh` file change:
- `CFG` to where your config file (`conf`) will be; read rights required - `CFG` to where your config file (`conf`) will be; read rights required
- `DAEMON` to point to the executable - `DAEMON` to point to the executable
- `PIDFILE` to point to a pid file daemon would have rights to create - `PIDFILE` to point to a pid file daemon would have rights to create
2. Go over everything in `conf`. Make sure `pid_file_path` matches `PIDFILE` from `tox_dht_bootstrap_server_daemon.sh` 2. Go over everything in `conf`. Make sure `pid_file_path` matches `PIDFILE` from `tox_bootstrap_daemon.sh`
3. Execute: 3. Execute:
``` ```
mv tox_dht_bootstrap_server_daemon.sh /etc/init.d/tox_dht_bootstrap_server_daemon mv tox_bootstrap_daemon.sh /etc/init.d/tox_bootstrap_daemon
``` ```
*(note that we removed `.sh` ending)* *(note that we removed `.sh` ending)*
4. Give the right permissions to this file: 4. Give the right permissions to this file:
``` ```
chmod 755 /etc/init.d/tox_dht_bootstrap_server_daemon chmod 755 /etc/init.d/tox_bootstrap_daemon
``` ```
5. Execute: 5. Execute:
``` ```
update-rc.d tox_dht_bootstrap_server_daemon defaults update-rc.d tox_bootstrap_daemon defaults
``` ```
6. Start the service: 6. Start the service:
``` ```
service tox_dht_bootstrap_server_daemon start service tox_bootstrap_daemon start
``` ```
7. Verify that the service is running: 7. Verify that the service is running:
``` ```
service tox_dht_bootstrap_server_daemon status service tox_bootstrap_daemon status
``` ```
-- --
You can see daemon's log with You can see daemon's log with
``` ```
grep "tox_dht_bootstrap_server_daemon" /var/log/syslog grep "tox_bootstrap_daemon" /var/log/syslog
``` ```
**Note that system log is where you find your public key** **Note that system log is where you find your public key**
@ -50,12 +50,12 @@ grep "tox_dht_bootstrap_server_daemon" /var/log/syslog
1. Check the log for errors with 1. Check the log for errors with
``` ```
grep "tox_dht_bootstrap_server_daemon" /var/log/syslog grep "tox_bootstrap_daemon" /var/log/syslog
``` ```
2. Check that paths in the beginning of `/etc/init.d/tox_dht_bootstrap_server_daemon` are valid 2. Check that paths in the beginning of `/etc/init.d/tox_bootstrap_daemon` are valid
3. Make sure that `PIDFILE` from `/etc/init.d/tox_dht_bootstrap_server_daemon` matches with the `pid_file_path` from `conf` 3. Make sure that `PIDFILE` from `/etc/init.d/tox_bootstrap_daemon` matches with the `pid_file_path` from `conf`
4. Make sure you have write permission to keys and pid files 4. Make sure you have write permission to keys and pid files

View File

@ -6,13 +6,13 @@ port = 33445
// The key file is like a password, so keep it where no one can read it. // The key file is like a password, so keep it where no one can read it.
// The daemon should have permission to read/write to it. // The daemon should have permission to read/write to it.
// Remember to replace the provided example with your own path. // Remember to replace the provided example with your own path.
keys_file_path = "/home/tom/.tox_dht_bootstrap_server_daemon/keys" keys_file_path = "/home/tom/.tox_bootstrap_daemon/keys"
// The PID file written to by daemon. // The PID file written to by daemon.
// Make sure that the user who runs the daemon has permissions to write to the // Make sure that the user who runs the daemon has permissions to write to the
// PID file. // PID file.
// Remember to replace the provided example with your own path. // Remember to replace the provided example with your own path.
pid_file_path = "/home/tom/.tox_dht_bootstrap_server_daemon/pid" pid_file_path = "/home/tom/.tox_bootstrap_daemon/pid"
// Enable IPv6. // Enable IPv6.
enable_ipv6 = false enable_ipv6 = false

View File

@ -1,6 +1,6 @@
/* tox_dht_bootstrap_server_daemon /* tox_bootstrap_daemon.c
* *
* A simple DHT bootstrap server for tox - daemon edition. * Tox DHT bootstrap server daemon.
* *
* Copyright (C) 2014 Tox project All Rights Reserved. * Copyright (C) 2014 Tox project All Rights Reserved.
* *
@ -42,13 +42,13 @@
#include "../../testing/misc_tools.c" #include "../../testing/misc_tools.c"
#define DAEMON_NAME "tox_dht_bootstrap_server_daemon" #define DAEMON_NAME "tox_bootstrap_daemon"
#define SLEEP_TIME_MILLISECONDS 30 #define SLEEP_TIME_MILLISECONDS 30
#define sleep usleep(1000*SLEEP_TIME_MILLISECONDS) #define sleep usleep(1000*SLEEP_TIME_MILLISECONDS)
#define DEFAULT_PID_FILE_PATH ".tox_dht_bootstrap_server_daemon.pid" #define DEFAULT_PID_FILE_PATH ".tox_bootstrap_daemon.pid"
#define DEFAULT_KEYS_FILE_PATH ".tox_dht_bootstrap_server_daemon.keys" #define DEFAULT_KEYS_FILE_PATH ".tox_bootstrap_daemon.keys"
#define DEFAULT_PORT 33445 #define DEFAULT_PORT 33445
#define DEFAULT_ENABLE_IPV6 0 // 1 - true, 0 - false #define DEFAULT_ENABLE_IPV6 0 // 1 - true, 0 - false
#define DEFAULT_ENABLE_LAN_DISCOVERY 1 // 1 - true, 0 - false #define DEFAULT_ENABLE_LAN_DISCOVERY 1 // 1 - true, 0 - false

View File

@ -1,18 +1,19 @@
#! /bin/sh #! /bin/sh
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: tox_dht_bootstrap_server_daemon # Provides: tox_bootstrap_daemon
# Required-Start: $remote_fs $syslog # Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog # Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5 # Default-Start: 2 3 4 5
# Default-Stop: 0 1 6 # Default-Stop: 0 1 6
# Short-Description: Starts the Tox bootstrapping server # Short-Description: Starts the Tox DHT bootstrapping server daemon
# Description: Starts the Tox bootstrapping server # Description: Starts the Tox DHT bootstrapping server daemon
### END INIT INFO ### END INIT INFO
# PATH should only include /usr/* if it runs after the mountnfs.sh script # PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="ProjectTox bootstrap server daemon" DESC="Tox DHT bootstrap server daemon"
NAME=tox_dht_bootstrap_server_daemon NAME=tox_bootstrap_daemon
# You may want to change USER if you are using it anywhere else
USER=tom USER=tom
CFG=/home/$USER/.$NAME/conf CFG=/home/$USER/.$NAME/conf
DAEMON=/home/$USER/$NAME DAEMON=/home/$USER/$NAME