diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-01-30 16:25:28 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-01-30 16:25:28 +0000 |
commit | c012c9c84e116d7d236f91350fe269c2f88b04bc (patch) | |
tree | 42bb84a50e711eb4f7265cecc3c13df53ceb9197 /cpp/src | |
parent | bug 1705: acceptor can block indefinitely (diff) | |
download | ice-c012c9c84e116d7d236f91350fe269c2f88b04bc.tar.bz2 ice-c012c9c84e116d7d236f91350fe269c2f88b04bc.tar.xz ice-c012c9c84e116d7d236f91350fe269c2f88b04bc.zip |
Updated /etc/init.d scripts
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Glacier2/Glacier2Router.cpp | 2 | ||||
-rwxr-xr-x | cpp/src/Ice/Service.cpp | 24 | ||||
-rw-r--r-- | cpp/src/IceBox/Service.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/IceGridNode.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/IceGridRegistry.cpp | 2 |
5 files changed, 19 insertions, 13 deletions
diff --git a/cpp/src/Glacier2/Glacier2Router.cpp b/cpp/src/Glacier2/Glacier2Router.cpp index ecca9f4bc84..9426ae244cd 100644 --- a/cpp/src/Glacier2/Glacier2Router.cpp +++ b/cpp/src/Glacier2/Glacier2Router.cpp @@ -503,7 +503,7 @@ Glacier2::RouterService::usage(const string& appName) "--daemon Run as a daemon.\n" "--noclose Do not close open file descriptors.\n" "--nochdir Do not change the current working directory.\n" - "--pidfile=<file> Write process ID to <file>." + "--pidfile <file> Write process ID to <file>." ); #endif print("Usage: " + appName + " [options]\n" + options); diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp index 9b2fbece80d..21f6a579eb5 100755 --- a/cpp/src/Ice/Service.cpp +++ b/cpp/src/Ice/Service.cpp @@ -400,14 +400,12 @@ Ice::Service::main(int& argc, char* argv[], const InitializationData& initData) } #else // - // Check for --daemon, --noclose, --nochdir and --pidfile= + // Check for --daemon, --noclose, --nochdir and --pidfile // bool daemonize = false; bool closeFiles = true; bool changeDirectory = true; string pidFile; - const char* pidFileArg = "--pidfile="; - const size_t pidFileLen = strlen(pidFileArg); int idx = 1; while(idx < argc) { @@ -441,15 +439,23 @@ Ice::Service::main(int& argc, char* argv[], const InitializationData& initData) changeDirectory = false; } - else if(strncmp(argv[idx], pidFileArg, pidFileLen) == 0) + else if(strcmp(argv[idx], "--pidfile") == 0) { - pidFile = argv[idx] + pidFileLen; + if(idx + 1 < argc) + { + pidFile = argv[idx + 1]; + } + else + { + cerr << argv[0] << ": --pidfile must be followed by an argument" << endl; + return EXIT_FAILURE; + } - for(int i = idx; i + 1 < argc; ++i) + for(int i = idx; i + 2 < argc; ++i) { - argv[i] = argv[i + 1]; + argv[i] = argv[i + 2]; } - argc -= 1; + argc -= 2; } else { @@ -465,7 +471,7 @@ Ice::Service::main(int& argc, char* argv[], const InitializationData& initData) if(pidFile.size() > 0 && !daemonize) { - cerr << argv[0] << ": --pidfile=<file> must be used with --daemon" << endl; + cerr << argv[0] << ": --pidfile <file> must be used with --daemon" << endl; return EXIT_FAILURE; } diff --git a/cpp/src/IceBox/Service.cpp b/cpp/src/IceBox/Service.cpp index 9b88e40c718..881c263fe25 100644 --- a/cpp/src/IceBox/Service.cpp +++ b/cpp/src/IceBox/Service.cpp @@ -130,7 +130,7 @@ IceBox::IceBoxService::usage(const string& appName) "--daemon Run as a daemon.\n" "--noclose Do not close open file descriptors.\n" "--nochdir Do not change the current working directory.\n" - "--pidfile=<file> Write process ID to <file>." + "--pidfile <file> Write process ID to <file>." ); #endif print("Usage: " + appName + " [options]\n" + options); diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index 3c1f207d975..012e35f8333 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -780,7 +780,7 @@ NodeService::usage(const string& appName) "--daemon Run as a daemon.\n" "--noclose Do not close open file descriptors.\n" "--nochdir Do not change the current working directory.\n" - "--pidfile=<file> Write process ID to <file>." + "--pidfile <file> Write process ID to <file>." ); #endif print("Usage: " + appName + " [options]\n" + options); diff --git a/cpp/src/IceGrid/IceGridRegistry.cpp b/cpp/src/IceGrid/IceGridRegistry.cpp index 38122379d50..825dc50bd4a 100644 --- a/cpp/src/IceGrid/IceGridRegistry.cpp +++ b/cpp/src/IceGrid/IceGridRegistry.cpp @@ -200,7 +200,7 @@ RegistryService::usage(const string& appName) "--daemon Run as a daemon.\n" "--noclose Do not close open file descriptors.\n" "--nochdir Do not change the current working directory.\n" - "--pidfile=<file> Write process ID to <file>." + "--pidfile <file> Write process ID to <file>." ); #endif print("Usage: " + appName + " [options]\n" + options); |