summaryrefslogtreecommitdiff
path: root/contrib/scripts/safe_asterisk
AgeCommit message (Collapse)Author
2016-09-09contrib: Let safe_asterisk script continue without /dev/tty9.Walter Doekes
If you use the safe_asterisk script, it uses hardcoded defaults before running configurable values from /etc/asterisk/startup.d. The hardcoded default has TTY=9. Some containerized environments don't have such a TTY, and safe_asterisk would stop. The custom configuration from /etc/asterisk/startup.d/* isn't read until after it stopped, so changing TTY in a custom config did not help. This changeset changes safe_asterisk to continue if the TTY setting was untouched and /dev/tty9 and /dev/vc/9 aren't found. Change-Id: I2c7cdba549b77f418a0af4cb1227e8e6fe4148fc
2014-10-09safe_asterisk: Don't automatically exceed MAXFILES value of 2^20.Walter Doekes
On systems with lots of RAM (e.g. 24GB) /proc/sys/fs/file-max divided by two can exceed the per-process file limit of 2^20. This patch ensures the value is capped. (Patch cleaned up by me.) ASTERISK-24011 #close Reported by: Michael Myles Patches: safe_asterisk-ulimit.diff uploaded by Michael Myles (License #6626) ........ Merged revisions 424875 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 424878 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 424879 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12safe_asterisk: Overwrite old safe_asterisk on make install.Walter Doekes
From now on, make install will overwrite safe_asterisk with the latest version. You need to move any local modifications to files inside /etc/asterisk/startup.d, if you have any. See also commits r394939 and r397938. ASTERISK-21965 #close Patches: safe_asterisk.patch uploaded by jkister (License 6232, modified by me) ........ Merged revisions 415748 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-09safe_asterisk: Cleanup additions to r415132.Walter Doekes
* Replaced a stray echo that should've been a message call in safe_asterisk. This replaces a conditional log message by a slightly different message. Please update your log parsing scripts. * Made the $NOTIFY mail Subject more verbose by adding the machine name and exitstatus. (Note that a 'make install' still won't overwrite your old safe_asterisk if it exists. See ASTERISK-21965.) ASTERISK-23492 #close ........ Merged revisions 415521 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415522 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415523 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-04safe_asterisk: Cleanup and debian compatibility.Walter Doekes
Cleans up the safe_asterisk script and adds the ASTSAFE_FOREGROUND option that allows the debian asterisk init script to capture the right pid. * Drop the vim #modeline which wasn't used. Use test consistently without the odd configure xno syntax. Double quote all paths. General cleanup. * Don't output message()s to the console but only to TTY if set. * Allow TTY to be "no" as well as empty (debian compatibility with debian/patches/safe_asterisk-config). * Add option to export ASTSAFE_FOREGROUND=1 from the init script that calls this to disable backgrounding. Debian uses a similar method in debian/patches/safe_asterisk-nobg). ASTERISK-23492 #close Review: https://reviewboard.asterisk.org/r/3574/ ........ Merged revisions 415132 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415171 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415172 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29Revert r394939 due to (numerous) objectionsMatthew Jordan
The patch from ASTERISK-21965 was committed perhaps a bit too hastily. Walter and Tzafrir have pointed out numerous issues with the approach and have propsed an alternative in r/2757. Since it's not a time critical issue and is not worth holding up the release of 12 for it, I've gone ahead and reverted r394939 from 12/trunk and re-opened ASTERISK-21965. ........ Merged revisions 397938 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-21Always install safe_asterisk; add configuration file supportMatthew Jordan
This patch modifies the behavior of safe_asterisk in two ways: (1) It modifies the Asterisk Makefile such that safe_asterisk is always installed on a 'make install'. This was done as bugfixes in the safe_asterisk script were not applied in previous version of Asterisk without first removing the old version of the script. (2) In order to keep a newly installed version of safe_asterisk from impacting local modifications, a new config file - safe_asterisk.conf.sample - has been provided. Settings that were previously modified in safe_asterisk can be set there instead. (closes issue ASTERISK-21965) Reported by: Jeremy Kister patches: safe_asterisk.patch uploaded by jkister (License 6232) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-21Update init.d scripts to handle stderr; readd splash screen for remote consolesMatthew Jordan
When r376428 was commited to re-order start up sequences to be more tolerant of forking with thread primitives, a few items were changed that caused changes in behavior on some distros. This includes: * Not displaying the splash screen on a remote console. * Displaying an error message on stderr when a remote console cannot connect to a running instance of Asterisk. In the first case, the splash screen was re-added (thanks to Michael L. Young). In the second case, the various init.d scripts were modified to pipe stderr to /dev/null, as the error message is useful - if you execute a remote console or a remote console command execution and it fail, it should tell you. Note that the error message was always present, it just failed to be printed prior to r376428. Much thanks to the folks who quickly reported this problem, provided solutions, and promptly tested the various init.d scripts on a variety of distros. (closes issue ASTERISK-20945) Reported by: Warren Selby Tested by: Michael L. Young, Jamuel Starkey, kaldemar, Danny Nicholas, mjordan patches: asterisk-20945-remote-intro-msg.diff uploaded by elguero (license 5026) ASTERISK-20945-1.8-mjordan.diff uploaded by mjordan (license 6283) ........ Merged revisions 379760 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 379777 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 379790 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-20This adds support for setting several safe_asterisk parameters usingMatthew Nicholson
environment variables and also enables a custom run directory for asterisk (instead of defaulting to /tmp). Patch by: Byron Clark (byronclark) (closes ASTERISK-17810) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05Merged revisions 317104 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r317104 | lmadsen | 2011-05-05 11:04:24 -0400 (Thu, 05 May 2011) | 15 lines Merged revisions 317102 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r317102 | lmadsen | 2011-05-05 10:54:46 -0400 (Thu, 05 May 2011) | 8 lines Disable console colourization inside safe_asterisk checks. (closes issue #19213) Reported by: lefoyer Patches: issue19213_strip_color_in_safe_asterisk-svn.patch uploaded by wdoekes (license 717) Tested by: wdoekes, lefoyer ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-06update safe_asterisk scriptDavid Ruggles
change defaults to make a little more sense. Default log location is now asterisk log location and default email notification has been changed to root on the local machine Review: https://reviewboard.asterisk.org/r/1067/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-12Merged revisions 239307 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r239307 | tilghman | 2010-01-11 21:18:36 -0600 (Mon, 11 Jan 2010) | 8 lines Portability and other fixes for the safe_asterisk script (closes issue #16416) Reported by: bklang Patches: safe_asterisk-compat-1.patch uploaded by bklang (license 919) 20100106__issue16416__trunk.diff.txt uploaded by tilghman (license 14) Tested by: bklang ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26Merged revisions 196657 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r196657 | file | 2009-05-26 10:06:09 -0300 (Tue, 26 May 2009) | 7 lines Remove some bash specific stuff from safe_asterisk. (closes issue #10812) Reported by: paravoid Patches: safe_asterisk_bashism.diff uploaded by tzafrir (license 46) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-21set ASTVARRUNDIR=$(localstatedir)/run/asterisk as default pathMichiel van Baak
When running asterisk as non-root and without this patch the pidfile wants to go into /var/run/asterisk.pid. This directory is not writable for the non-root user and changing permissions is not an option. Putting it in /var/run/asterisk/asterisk.pid makes it possible to set permissions on the /var/run/asterisk dir so everything works as it should be. Patched committed is based on pabelanger's patch. (closes issue #13153) Reported by: pabelanger Patches: 2009012900_bug13153-nonrootscripts.diff.txt uploaded by mvanbaak (license 7) Review: http://reviewboard.digium.com/r/139/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16Set up umask as a possible configuration option.Tilghman Lesher
(closes issue #13753) Reported by: irroot git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07use pkill instead of killall to be more portableMichiel van Baak
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-01Make safe_asterisk work on dash/sh/bash etc.Michiel van Baak
(closes issue #13111) Reported by: pabelanger Patches: 2008071901_issue13111_safe_asterisk.diff uploaded by mvanbaak (license 7) Tested by: mvanbaak, pabelanger git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30Merged revisions 119301 via svnmerge from Michiel van Baak
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r119301 | mvanbaak | 2008-05-30 18:44:39 +0200 (Fri, 30 May 2008) | 14 lines dont use a bashism way to check the $VERSION variable. The rc/init.d scripts, and safe_asterisk work on normal sh now again. Tested on: OpenBSD 4.2 (me) Debian etch (me) Ubuntu Hardy (me and loloski) FC9 (loloski) (closes issue #12687) Reported by: loloski Patches: 20080529-12687-safe_asterisk-fixversion.diff.txt uploaded by mvanbaak (license 7) Tested by: loloski, mvanbaak ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05Merged revisions 115285 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r115285 | tilghman | 2008-05-04 22:22:25 -0500 (Sun, 04 May 2008) | 7 lines When starting Asterisk, bug out if Asterisk is already running. (closes issue #12525) Reported by: explidous Patches: 20080428__bug12525.diff.txt uploaded by Corydon76 (license 14) Tested by: mvanbaak ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20Merged revisions 83316 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83316 | russell | 2007-09-20 16:01:20 -0500 (Thu, 20 Sep 2007) | 3 lines Change safe_asterisk to explicitly ask for /bin/bash, as it uses bashisms. (closes issue #10772, reported by culrich) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06Incorporate the ability to log output of safe_asterisk to syslog (closes ↵Tilghman Lesher
issue #9882) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18Merged revisions 69744 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r69744 | tilghman | 2007-06-18 12:46:40 -0500 (Mon, 18 Jun 2007) | 10 lines Merged revisions 69743 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r69743 | tilghman | 2007-06-18 12:45:15 -0500 (Mon, 18 Jun 2007) | 2 lines Issue 9998 - Remove SIG prefix, since it's not supported by ksh ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-11Merged revisions 63905 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r63905 | tilghman | 2007-05-11 11:35:51 -0500 (Fri, 11 May 2007) | 10 lines Merged revisions 63903 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r63903 | tilghman | 2007-05-11 11:31:03 -0500 (Fri, 11 May 2007) | 2 lines Issue 9121 - fixups for safe_asterisk script ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-14add the ability to run an arbitrary command if asterisk crashesRussell Bryant
(inspired by issue #7698, which was res_segfault by anthm) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-19Merged revisions 21638 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r21638 | kpfleming | 2006-04-19 16:10:41 -0500 (Wed, 19 Apr 2006) | 2 lines support system-specific scripts in safe_asterisk, before starting Asterisk proper ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-24Make sure safe_asterisk retains previous script defaultsMatthew Fredrickson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-24Updates from royk to safe_asterisk (#5207) Thanks!Matthew Fredrickson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29remove extraneous svn:executable propertiesKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-08-14Build safe_asterisk script substituting the proper path in (bug #4952, patch ↵Mark Spencer
not used) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-12-01Specify hostname if there is a crash (bug #2958)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-07-25Let safe_asterisk take arguments (bug #2085)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-03-12Fix safe_asterisk scriptMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2003-05-07Add debugging to safe_asteriskMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2003-02-18mar feb 18 19:15:15 CET 2003Matteo Brancaleoni
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2002-10-08Version 0.3.0 from FTPMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2002-07-30Version 0.2.0 from FTPMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2002-05-27Version 0.1.12 from FTPMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@452 65c4cc65-6c06-0410-ace0-fbb531ad65f3