Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
modem-manager output prolisso
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Sun Sep 02, 2012 11:08 am    Post subject: modem-manager output prolisso Reply with quote

Salve a tutti,

all'avvio, NetworkManager richiama modem-manager ma lo fa impostando l'output non silenzioso e quindi mi compaiono i mille messaggi di modem-manager che vorrei nascondere.

Come posso fare a rendere silente l'output? Da dove viene richiamato modem-manager? (così posso mettere un bel --log-level=ERR)
Back to top
View user's profile Send private message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Sun Sep 02, 2012 11:28 am    Post subject: Reply with quote

Sembra si debba comunicare con dbus:

Code:
dbus-send --print-reply --system --dest=org.freedesktop.ModemManager /org/freedesktop/ModemManager org.freedesktop.ModemManager.SetLogging string:ERR


Ma dove metterlo in un file di configurazione per non doverlo fare manualmente ogni volta?
Back to top
View user's profile Send private message
ago
Developer
Developer


Joined: 01 Mar 2008
Posts: 1527
Location: Milan, Italy

PostPosted: Sun Sep 02, 2012 6:12 pm    Post subject: Reply with quote

Non scrivere 2 messaggi di fila, edita il precedente.

Una soluzione semplice potrebbe essere quella di piazzare
Code:
> /dev/null 2>&1
ove necessario
Back to top
View user's profile Send private message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Sun Sep 02, 2012 8:53 pm    Post subject: Reply with quote

Quote:
Non scrivere 2 messaggi di fila, edita il precedente.


Pardon, la fretta.

Quote:
Una soluzione semplice potrebbe essere quella di piazzare


Ci ho provato, (&>/dev/null) ma non funziona, forse perché é chiamato indipendentemente da dbus e non da NetworkManager direttamente...

Cmq è una soluzione che avrei preferito comunque evitare se c'è un modo per impostare il livello di log!
Back to top
View user's profile Send private message
ago
Developer
Developer


Joined: 01 Mar 2008
Posts: 1527
Location: Milan, Italy

PostPosted: Sun Sep 02, 2012 9:04 pm    Post subject: Reply with quote

prova a postare un diff -ru di quello che hai fatto
Back to top
View user's profile Send private message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Mon Sep 03, 2012 5:20 pm    Post subject: Reply with quote

Code:
#!/sbin/runscript
# Copyright (c) 2008 Saleem Abdulrasool <compnerd@compnerd.org>
# Distributed under the terms of the GNU General Purpose License v2
# $Header: $

description="NetworkManager daemon. The service is marked as started only \
when a network connection is established."

depend() {
   need dbus
   provide net
}

start() {
   # If we are re-called by a dispatcher event, we want to mark the service
   # as started without starting the daemon again
   yesno "${IN_BACKGROUND}" && return 0

   [ -z "${INACTIVE_TIMEOUT}" ] && INACTIVE_TIMEOUT="1"

   ebegin "Starting NetworkManager"
   start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager.pid \
      --exec /usr/sbin/NetworkManager -- --pid-file /var/run/NetworkManager.pid
   local _retval=$? &>/dev/null
   eend "${_retval}"
   if [ "x${_retval}" = 'x0' ] && ! nm-online -t "${INACTIVE_TIMEOUT}"; then
      einfo "Marking NetworkManager as inactive. It will automatically be marked"
      einfo "as started after a network connection has been established."
      mark_service_inactive
   fi
   return "${_retval}"
}

stop() {
   # If we are re-called by a dispatcher event, we want to mark the service
   # as inactive without stopping the daemon
   if yesno "${IN_BACKGROUND}"; then
      mark_service_inactive "${SVCNAME}"
      return 0
   fi

   ebegin "Stopping NetworkManager"
   start-stop-daemon --stop --quiet --pidfile /var/run/NetworkManager.pid
   eend $?
}

# vim: set ft=gentoo-init-d ts=3 sw=3 et:


P.s. Ok, i colori non funzionano in "code":
start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager.pid \
--exec /usr/sbin/NetworkManager -- --pid-file /var/run/NetworkManager.pid
local _retval=$? &>/dev/null
Back to top
View user's profile Send private message
ago
Developer
Developer


Joined: 01 Mar 2008
Posts: 1527
Location: Milan, Italy

PostPosted: Mon Sep 03, 2012 7:54 pm    Post subject: Reply with quote

la mia soluzione non è uguale alla tua..hai provato come ti ho consigliato?
Back to top
View user's profile Send private message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Tue Sep 04, 2012 6:12 am    Post subject: Reply with quote

ago wrote:
la mia soluzione non è uguale alla tua..hai provato come ti ho consigliato?


Dovrebbe essere lo stesso, uso Bash 4.2.37 che supporta anche la nuova sintassi. Comunque ora provo a mettere "> /dev/null 2>&1"

Non sapresti come potrei modificare la configurazione di dbus? Sarebbe più canonica come soluzione, non annullerei anche potenziali output utili...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum