From d8f2072ab5e1a7e5a8a96db077d40cb28c1a9a24 Mon Sep 17 00:00:00 2001 From: Maxim Biro Date: Sun, 19 Jan 2014 15:27:29 -0500 Subject: [PATCH 1/2] Fixed function conflict --- .../bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c b/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c index 8944993c..3c6d7b4e 100644 --- a/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c +++ b/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c @@ -273,7 +273,7 @@ next: // returns 1 on success // 0 on failure -int is_connected(DHT *dht, int port, int enable_lan_discovery) +int try_connect(DHT *dht, int port, int enable_lan_discovery) { uint16_t htons_port = htons(port); @@ -382,7 +382,7 @@ int main(int argc, char *argv[]) return 1; } - if (is_connected(dht, port, enable_lan_discovery)) { + if (try_connect(dht, port, enable_lan_discovery)) { syslog(LOG_INFO, "Successfully connected to DHT\n"); } else { syslog(LOG_ERR, "Couldn't connect to the DHT. Check settings and network connections. Exiting.\n"); From c3763cb708dccf13140af901dd214756a80262ab Mon Sep 17 00:00:00 2001 From: Maxim Biro Date: Sun, 19 Jan 2014 17:21:24 -0500 Subject: [PATCH 2/2] Added .sh to the script --- other/bootstrap_serverdaemon/Makefile.inc | 2 +- other/bootstrap_serverdaemon/README.md | 7 ++++--- ...ap_server_daemon => tox_dht_bootstrap_server_daemon.sh} | 0 3 files changed, 5 insertions(+), 4 deletions(-) rename other/bootstrap_serverdaemon/{tox_dht_bootstrap_server_daemon => tox_dht_bootstrap_server_daemon.sh} (100%) diff --git a/other/bootstrap_serverdaemon/Makefile.inc b/other/bootstrap_serverdaemon/Makefile.inc index 287500b1..5ab17b56 100644 --- a/other/bootstrap_serverdaemon/Makefile.inc +++ b/other/bootstrap_serverdaemon/Makefile.inc @@ -23,5 +23,5 @@ endif EXTRA_DIST += \ $(top_srcdir)/other/bootstrap_serverdaemon/conf \ - $(top_srcdir)/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon + $(top_srcdir)/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.sh \ No newline at end of file diff --git a/other/bootstrap_serverdaemon/README.md b/other/bootstrap_serverdaemon/README.md index 0c423675..30cb14aa 100644 --- a/other/bootstrap_serverdaemon/README.md +++ b/other/bootstrap_serverdaemon/README.md @@ -2,17 +2,18 @@ The following commands are to be executed as root: -1. In `tox_dht_bootstrap_server_daemon` file change: +1. In `tox_dht_bootstrap_server_daemon.sh` file change: - `CFG` to where your config file (`conf`) will be; read rights required - `DAEMON` to point to the executable - `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` +2. Go over everything in `conf`. Make sure `pid_file_path` matches `PIDFILE` from `tox_dht_bootstrap_server_daemon.sh` 3. Execute: ``` -mv tox_dht_bootstrap_server_daemon /etc/init.d/tox_dht_bootstrap_server_daemon +mv tox_dht_bootstrap_server_daemon.sh /etc/init.d/tox_dht_bootstrap_server_daemon ``` +*(note that we removed `.sh` ending)* 4. Give the right permissions to this file: ``` diff --git a/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon b/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.sh similarity index 100% rename from other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon rename to other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.sh