Commit 41227d23 authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: use WRS_LOG_OTHER for wrs_auxclk at startup

An alternative to "set -o pipefail" in the
userspace/rootfs_override/etc/init.d/wrs_auxclk.sh is ${PIPESTATUS[0]},
but this is a bashism.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent e9b1a5f4
......@@ -274,6 +274,7 @@ config WRS_LOG_OTHER
Redirect output from other programs.
In the current version following programs uses this option:
--wrs_watchdog
--wrs_auxclk
This collective entry is to avoid number of entries in dot-config.
The string can be a pathname (e.g. /dev/kmsg) or a <facility>.<level>
spefification like "daemon.debug". An empty strings is used
......
......@@ -575,6 +575,7 @@ value is changed by the web interface, proper action is taken.
@t{CONFIG_WRS_LOG_OTHER} is currently used by:
@itemize
@item wrs_watchdog
@item wrs_auxclk
@end itemize
Each value
can be a pathname, to select logging to file (and @t{/dev/kmsg}
......
......@@ -4,6 +4,7 @@
# First, read dot-config to get wrs_auxclk parameters
dotconfig=/wr/etc/dot-config
set -o pipefail
if [ -f $dotconfig ]; then
. $dotconfig
......@@ -33,10 +34,26 @@ if [ ! -z "$CONFIG_WRSAUXCLK_PPSHIFT" ]; then
p_ppshift="--ppshift "$CONFIG_WRSAUXCLK_PPSHIFT;
fi
WRS_LOG=$CONFIG_WRS_LOG_OTHER
# if empty turn it to /dev/null
if [ -z $WRS_LOG ]; then
WRS_LOG="/dev/null";
fi
# if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
else
# not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t wr-switch -p $WRS_LOG\"
fi
# execute wrs_auxclk
echo -n "Configuring external clock clk2: "
/wr/bin/wrs_auxclk $p_freq $p_duty $p_cshift $p_sigdel $p_ppshift > /dev/null 2>&1
if [ $? == 0 ]; then
eval /wr/bin/wrs_auxclk $p_freq $p_duty $p_cshift $p_sigdel $p_ppshift $LOGPIPE
ret=$?
if [ $ret -eq 0 ]; then
echo "OK"
else
echo "Failed"
......
../init.d/wrs_auxclk
\ No newline at end of file
../init.d/wrs_auxclk.sh
\ No newline at end of file
......@@ -189,7 +189,7 @@ int main(int argc, char *argv[])
}
apply_settings(&calc);
printf("Applied settings:\n");
printf("%s: applied settings:\n", argv[0]);
print_settings(stdout, &calc);
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment