Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 859524 Details for
Bug 903775
>=net-misc/asterisk-1.6.26 - init script wrapper requires bash
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
asterisk_wrapper converted to plain sh
asterisk_wrapper.diff (text/plain), 2.51 KB, created by
Ed Wildgoose
on 2023-04-04 18:13:04 UTC
(
hide
)
Description:
asterisk_wrapper converted to plain sh
Filename:
MIME Type:
Creator:
Ed Wildgoose
Created:
2023-04-04 18:13:04 UTC
Size:
2.51 KB
patch
obsolete
>--- /mnt/ro/fs/usr/sbin/asterisk_wrapper >+++ /mnt/changes/usr/sbin/asterisk_wrapper >@@ -1,4 +1,4 @@ >-#! /bin/bash >+#! /bin/sh > # Copyright 1999-2022 Gentoo Authors > # Distributed under the terms of the GNU General Public License v2 > >@@ -83,9 +83,9 @@ > done > shift # -- > >-ast_opts=("$@") >+ast_opts="$@" > >-if ! [[ "${restartdelay}" =~ ^[1-9][0-9]*$ ]]; then >+if ! printf "%s\n" "${restartdelay}" | grep -qE '^[1-9][0-9]*$' ; then > echo "Invalid --restartdelay value ${restartdelay}, resetting to 5." >&2 > restartdelay=5 > fi >@@ -108,7 +108,7 @@ > # To fix this is quite complex in that we need to keep an fd, compare inode numbers > # and manage flock's. > [[ -r "${rundir}/${progname}.pid" ]] && \ >- [[ "$(<"${rundir}/${progname}.pid")" = $$ ]] && \ >+ [[ "$(cat "${rundir}/${progname}.pid")" = $$ ]] && \ > rm "${rundir}/${progname}.pid" > } > trap cleanup EXIT >@@ -118,7 +118,7 @@ > # config file and request a core stop when convenient so that we can take over. > echo $$ > "${rundir}/${progname}.pid" > if [[ -r "${rundir}/asterisk.pid" ]]; then >- ast_pid="$(<"${rundir}/asterisk.pid")" >+ ast_pid="$(cat "${rundir}/asterisk.pid")" > [[ -r "/proc/${ast_pid}/cmdline" ]] && ast_conf="$(tr '\0' '\n' < "/proc/${ast_pid}/cmdline" | grep -A1 '^-C$' | tail -n1)" && /usr/sbin/asterisk -C "${ast_conf:-/etc/asterisk/asterisk.conf}" -rx "core stop when convenient" > # We may hit a few (depending on how busy the server is a great many number) loop failures still ... > fi >@@ -126,28 +126,29 @@ > ulimit -c "${dumpcore}" > ulimit -n "${maxfd}" > >-ast_cmd=() >+ast_cmd="" > if [ -n "${nicelevel}" ]; then >- ast_cmd+=(nice -n "${nicelevel}") >+ ast_cmd="${ast_cmd} nice -n ${nicelevel}" > fi >-ast_cmd+=(/usr/sbin/asterisk "${ast_opts[@]}") >+ast_cmd="${ast_cmd} /usr/sbin/asterisk ${ast_opts}" > >+ > while [[ -r "${rundir}/${progname}.pid" ]]; do > # Another instance is looking to replace us, so terminate. >- if [[ "$(<"${rundir}/${progname}.pid")" != $$ ]]; then >+ if [[ "$(cat "${rundir}/${progname}.pid")" != $$ ]]; then > break > fi > >- echo "Starting asterisk with ${ast_opts[*]}" >+ echo "Starting asterisk with ${ast_opts}" > if [ -n "${tty+yes}" ]; then > /bin/stty -F "${tty}" sane >- "${ast_cmd[@]}" >"${tty}" 2>&1 <"${tty}" >+ ${ast_cmd} >"${tty}" 2>&1 <"${tty}" > result=$? > else > # Purposefully leave stderr alone, this will under certain odd cases (like exceptions, > # and other odd cases logged from glibc) result in those logs at least being captured > # in syslog. >- "${ast_cmd[@]}" </dev/null >/dev/null >+ ${ast_cmd} </dev/null >/dev/null > result=$? > fi >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 903775
: 859524 |
861435
|
861436