Open bigguiness opened 6 years ago
I figured out a solution to avoid the noise in the journal.
The following patch first checks the id or the user. If it's root, the "sudo -A" is removed from the various "bash -c "echo ..." commands. If the if is non-root, the "sudo -A" is used.
Regards
--- config-pin.orig 2018-05-08 09:05:19.399629072 -0700 +++ config-pin 2018-05-08 09:11:12.341035364 -0700 @@ -1,5 +1,11 @@
+if ! id | grep -q root; then
OCPDIR=/sys/devices/ocp.* GPIODIR=/sys/class/gpio @@ -879,7 +885,7 @@
for FILE in $SLOTS ; do
echo_std Loading $DTBO overlay
for FILE in $OCPDIR${PIN}_pinmux/state ; do
echo_dbg "echo $MODE > $FILE"
for FILE in $OCPDIR/${PIN}_pinmux.*/state ; do
echo_dbg "echo $MODE > $FILE"
Well... that did't post well... Not sure how this Markdown stuff works...
Maybe this will work...
`--- config-pin.orig 2018-05-08 09:05:19.399629072 -0700 +++ config-pin 2018-05-08 09:11:12.341035364 -0700 @@ -1,5 +1,11 @@
+if ! id | grep -q root; then
OCPDIR=/sys/devices/ocp.* GPIODIR=/sys/class/gpio @@ -879,7 +885,7 @@
for FILE in $SLOTS ; do
echo_std Loading $DTBO overlay
for FILE in $OCPDIR${PIN}_pinmux/state ; do
echo_dbg "echo $MODE > $FILE"
for FILE in $OCPDIR/${PIN}_pinmux.*/state ; do
echo_dbg "echo $MODE > $FILE"
Nope... If you need the patch please let me know and I will email it to you.
I have a systemd service that uses config-pin to load the cape-universal overlay and then uses a file with config-pin to configure the pins. When it starts I get a bunch of noise in the systemd journal like:
Apr 06 10:11:21 beaglebone sudo[547]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/bash -c echo cape-universal > /sys/devices/bone_capemgr.*/slots Apr 06 10:11:21 beaglebone sudo[547]: pam_unix(sudo:session): session opened for user root by (uid=0) Apr 06 10:11:22 beaglebone sudo[547]: pam_unix(sudo:session): session closed for user root Apr 06 10:11:23 beaglebone sudo[789]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/bash -c echo low > /sys/class/gpio/gpio66/direction Apr 06 10:11:23 beaglebone sudo[789]: pam_unix(sudo:session): session opened for user root by (uid=0) Apr 06 10:11:23 beaglebone sudo[789]: pam_unix(sudo:session): session closed for user root Apr 06 10:11:23 beaglebone sudo[803]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/bash -c echo gpio > /sys/devices/ocp.3/P8_07_pinmux.14/state Apr 06 10:11:23 beaglebone sudo[803]: pam_unix(sudo:session): session opened for user root by (uid=0) Apr 06 10:11:23 beaglebone sudo[803]: pam_unix(sudo:session): session closed for user root
There are similar messages for each direction/state setting.
Is there anyway to suppress these messages? They add a lot of noise to the journal.
Thanks