summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-09-29 02:38:24 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-09-29 02:38:24 +0000
commit61a0f7a65e8cdfa1d87bcb9e7c451f4a70b56347 (patch)
tree423f20dd59ab62da1d25f3a345f231de3b8a54f6
parentea215f5b7dfd8e160b742aa2f3533dbd8f3fc4c0 (diff)
install 'rasterisk' symlink and update process name when used remotely (issue #5318 with minor mod)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-xMakefile1
-rwxr-xr-xasterisk.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 6dffd8cd4..0cc3fcd65 100755
--- a/Makefile
+++ b/Makefile
@@ -591,6 +591,7 @@ bininstall: all
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
+ ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
diff --git a/asterisk.c b/asterisk.c
index 2aa7c0c52..e1842fb86 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -1969,6 +1969,16 @@ int main(int argc, char *argv[])
}
}
+ /* For remote connections, change the name of the remote connection.
+ * We do this for the benefit of init scripts (which need to know if/when
+ * the main asterisk process has died yet). */
+ if (option_remote) {
+ strcpy(argv[0], "rasterisk");
+ for (x = 1; x < argc; x++) {
+ argv[x] = argv[0] + 10;
+ }
+ }
+
if (option_dumpcore) {
struct rlimit l;
memset(&l, 0, sizeof(l));