User Tools

Site Tools


doc:uci:system

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:uci:system [2012/11/25 18:42]
encukou Document Morse code LED trigger
doc:uci:system [2014/08/08 12:29] (current)
valentt
Line 16: Line 16:
 | ''​hostname''​ | string | no | ''​OpenWrt''​ | The hostname for this system. | | ''​hostname''​ | string | no | ''​OpenWrt''​ | The hostname for this system. |
 | ''​buffersize''​ | integer | no | kernel specific | Size of the kernel message buffer. | | ''​buffersize''​ | integer | no | kernel specific | Size of the kernel message buffer. |
-| ''​conloglevel''​ | integer | no | ''​7''​ | The maximum [[http://​www.kernel.org/​doc/​man-pages/​online/​pages/​man2/​syslog.2.html|log level]] for kernel messages to be logged to the console. Only messages with a level lower than this will be printed to the console. |+| ''​conloglevel''​ | integer | no | ''​7''​ | Number between 0-8. The maximum [[http://​www.kernel.org/​doc/​man-pages/​online/​pages/​man2/​syslog.2.html|log level]] for kernel messages to be logged to the console. Only messages with a level lower than this will be printed to the console. Higher level messages have lower log level number. Highest level messages are ones with log level 0. If you want more verbous messages in console put conloglevel to 8 if you want less messages lower conloglevel to 4 or even less.|
 | ''​cronloglevel''​ | integer | no | ''​5''​ | The minimul level for cron messages to be logged to syslog. ''​0''​ will print all debug messages, ''​8''​ will log command executions, and ''​9''​ or higher will only log error messages. | | ''​cronloglevel''​ | integer | no | ''​5''​ | The minimul level for cron messages to be logged to syslog. ''​0''​ will print all debug messages, ''​8''​ will log command executions, and ''​9''​ or higher will only log error messages. |
 | ''​klogconloglevel''​ | integer | no | ''​7''​ | The maximum [[http://​www.kernel.org/​doc/​man-pages/​online/​pages/​man2/​syslog.2.html|log level]] for kernel messages to be logged to the console. Only messages with a level lower than this will be printed to the console. Identical to ''​conloglevel''​ and will override it. | | ''​klogconloglevel''​ | integer | no | ''​7''​ | The maximum [[http://​www.kernel.org/​doc/​man-pages/​online/​pages/​man2/​syslog.2.html|log level]] for kernel messages to be logged to the console. Only messages with a level lower than this will be printed to the console. Identical to ''​conloglevel''​ and will override it. |
-| ''​log_file''​ | string | no | ''/​var/​log/​messages'' ​| File to write log messages to (type ''​file''​). |+| ''​log_file''​ | string | no | no log file | File to write log messages to (type ''​file''​). The default is to not write a log in a file. The most often used location for a system log file is ''/​var/​log/​messages''​.|
 | ''​log_ip''​ | IP address | no | //(none)// | IP address of a syslog server to which the log messages should be sent in addition to the local destination. | | ''​log_ip''​ | IP address | no | //(none)// | IP address of a syslog server to which the log messages should be sent in addition to the local destination. |
 | ''​log_port''​ | integer | no | ''​514''​ | Port number of the remote syslog server specified with ''​log_ip''​. | | ''​log_port''​ | integer | no | ''​514''​ | Port number of the remote syslog server specified with ''​log_ip''​. |
 +| ''​log_prefix''​ | string | no |//​(none)//​| Adds a prefix to all log messages send over network. |
 | ''​log_size''​ | integer | no | ''​16''​ | Size of the file or circular memory buffer in KiB. | | ''​log_size''​ | integer | no | ''​16''​ | Size of the file or circular memory buffer in KiB. |
 | ''​log_type''​ | string | no | ''​circular''​ | Either ''​circular''​ or ''​file''​. | | ''​log_type''​ | string | no | ''​circular''​ | Either ''​circular''​ or ''​file''​. |
 | ''​timezone''​ | string | no | ''​UTC''​ | The time zone that date and time should be rendered in by default. A list of possible values is in the ''​TZ string''​ column of the [[.:​system#​time.zones|Time Zones]] table. | | ''​timezone''​ | string | no | ''​UTC''​ | The time zone that date and time should be rendered in by default. A list of possible values is in the ''​TZ string''​ column of the [[.:​system#​time.zones|Time Zones]] table. |
 +| ''​zonename''​ | string | no | ''​UTC''​ | Only useful when using eglibc and zoneinfo! (''​LIBC_USE_EGLIBC'',​ ''​PACKAGE_zoneinfo-*''​) The time zone that date and time should be rendered in by default. Suppose you want to use Brussels'​ timezone, set this value to ''​Europe/​Brussels''​. Possible values can be found by running ''​(cd /​usr/​share/​zoneinfo;​ find *)''​ |
  
 ==== Remote Time (ntp) ==== ==== Remote Time (ntp) ====
Line 51: Line 53:
  
  
-If the above configuration is missing in the file ''/​etc/​config/​system''​ (or faulty), busybox-nptd will not be started! You can manually invoke it by e.g.<​code bash>​ntpd -q -p ptbtime1.ptb.de</​code>​+If the above configuration is missing in the file ''/​etc/​config/​system''​ (or faulty), busybox-nptd will not be started! You can manually invoke it by e.g.<​code bash>​ntpd -q -p openwrt.pool.ntp.org</​code>​
  
  
 ==== Leds ==== ==== Leds ====
  
-OpenWRT supports using the routers ​LEDs to give feedback about it'​s ​status. Which LEDs are available to be controlled through OpenWRT depends on the specific router model.+OpenWRT supports using the router'​s ​LEDs to give feedback about its status. Which LEDs are available to be controlled through OpenWRT depends on the specific router model.
  
 LEDs are represented by entries in the ''​sys''​ filesystem. You can check which LEDs are available in the ''/​sys/​class/​leds''​ directory. The name of an entry typically consists of the name of the hardware providing the LED (the router model), the color of the LED, and it's designation (usually the label on the case). Some LEDs can show different colors. In this case, you will find one entry per color. LEDs are represented by entries in the ''​sys''​ filesystem. You can check which LEDs are available in the ''/​sys/​class/​leds''​ directory. The name of an entry typically consists of the name of the hardware providing the LED (the router model), the color of the LED, and it's designation (usually the label on the case). Some LEDs can show different colors. In this case, you will find one entry per color.
Line 66: Line 68:
 | ''​cat /​sys/​class/​leds/​**LED**/​trigger | ''​cat /​sys/​class/​leds/​**LED**/​trigger
 [none] timer default-on netdev morse usbdev''​ | [none] timer default-on netdev morse usbdev''​ |
 +<code bash>​opkg list-installed kmod-ledtrig*
 +opkg list kmod-ledtrig*</​code>​
  
 To allow more triggers it's necessary to build your own OpenWRT or install some packages (like ledtrig-morse). To allow more triggers it's necessary to build your own OpenWRT or install some packages (like ledtrig-morse).
 +
 +If you build your own OpenWrt and try to install any kmod-* package from OpenWrt repository, it will fail. In this case is safe to force install:
 +<code bash>​opkg install kmod-ledtrig-morse --force-depends</​code>​
 +
  
 === None === === None ===
  
-The LED is OFF.+The LED is always in default state. Unlisted LED are default ​OFF, so this is only useful to declare a LED to be always ON.
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
 +| ''​default''​ | integer | no | 0 | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON |
 | ''​sysfs''​ | string | yes | //(none)// | LED device name | | ''​sysfs''​ | string | yes | //(none)// | LED device name |
 | ''​trigger''​ | string | yes | //(none)// | ''​none''​ | | ''​trigger''​ | string | yes | //(none)// | ''​none''​ |
Line 79: Line 88:
  
 The LED blinks with the configured on/off frequency. The LED blinks with the configured on/off frequency.
 +<code bash>​opkg install kmod-ledtrig-timer</​code>​
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
 +| ''​default''​ | integer | no | 0 | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON |
 | ''​delayoff''​ | integer | yes | //(none)// | How long (in milliseconds) the LED should be off. | | ''​delayoff''​ | integer | yes | //(none)// | How long (in milliseconds) the LED should be off. |
 | ''​delayon''​ | integer | yes | //(none)// | How long (in milliseconds) the LED should be on. | | ''​delayon''​ | integer | yes | //(none)// | How long (in milliseconds) the LED should be on. |
Line 87: Line 98:
 === Default-on === === Default-on ===
  
-The LED is ON.+The LED is ON. Deprecated, use default=1 trigger=none instead. 
 +<code bash>​opkg install kmod-ledtrig-default-on</​code>​ 
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
 +| ''​default''​ | integer | no | 0 | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON |
 | ''​sysfs''​ | string | yes | //(none)// | LED device name | | ''​sysfs''​ | string | yes | //(none)// | LED device name |
 | ''​trigger''​ | string | yes | //(none)// | ''​default-on''​ | | ''​trigger''​ | string | yes | //(none)// | ''​default-on''​ |
Line 95: Line 109:
  
 The LED flashes to simulate actual heart beat //​thump-thump-pause//​. The frequency is in direct proportion to 1-minute average CPU load.(([[http://​git.kernel.org/?​p=linux/​kernel/​git/​stable/​linux-stable.git;​a=blob_plain;​f=drivers/​leds/​ledtrig-heartbeat.c;​hb=HEAD|Source file of heartbeat trigger]])) The LED flashes to simulate actual heart beat //​thump-thump-pause//​. The frequency is in direct proportion to 1-minute average CPU load.(([[http://​git.kernel.org/?​p=linux/​kernel/​git/​stable/​linux-stable.git;​a=blob_plain;​f=drivers/​leds/​ledtrig-heartbeat.c;​hb=HEAD|Source file of heartbeat trigger]]))
 +<code bash>​opkg install kmod-ledtrig-heartbeat</​code>​
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
 +| ''​default''​ | integer | no | 0 | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON |
 | ''​sysfs''​ | string | yes | //(none)// | LED device name | | ''​sysfs''​ | string | yes | //(none)// | LED device name |
 | ''​trigger''​ | string | yes | //(none)// | ''​heartbeat''​ | | ''​trigger''​ | string | yes | //(none)// | ''​heartbeat''​ |
Line 105: Line 121:
 The LED flashes as data is written to flash memory. The LED flashes as data is written to flash memory.
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
 +| ''​default''​ | integer | no | 0 | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON |
 | ''​sysfs''​ | string | yes | //(none)// | LED device name | | ''​sysfs''​ | string | yes | //(none)// | LED device name |
 | ''​trigger''​ | string | yes | //(none)// | ''​nand-disk''​ | | ''​trigger''​ | string | yes | //(none)// | ''​nand-disk''​ |
Line 111: Line 128:
  
 The LED flashes with link status and/or send and receive activity on the configured interface. The LED flashes with link status and/or send and receive activity on the configured interface.
 +<code bash>​opkg install kmod-ledtrig-netdev</​code>​
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
 +| ''​default''​ | integer | no | 0 | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON |
 | ''​dev''​ | string | yes | //(none)// | Name of the network interface which status should be reflected | | ''​dev''​ | string | yes | //(none)// | Name of the network interface which status should be reflected |
 | ''​mode''​ | string | yes | //(none)// | One or more of ''​link'',​ ''​tx'',​ or ''​rx'',​ seperated by spaces | | ''​mode''​ | string | yes | //(none)// | One or more of ''​link'',​ ''​tx'',​ or ''​rx'',​ seperated by spaces |
Line 126: Line 145:
 since ''​wlan0''​ may be referring to 2.4 GHz or 5 GHz radio based on current network setup. since ''​wlan0''​ may be referring to 2.4 GHz or 5 GHz radio based on current network setup.
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
 +| ''​default''​ | integer | no | 0 | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON |
 | ''​sysfs''​ | string | yes | //(none)// | LED device name | | ''​sysfs''​ | string | yes | //(none)// | LED device name |
 | ''​trigger''​ | string | yes | //(none)// | ''​phy0rx'',​ ''​phy0tx'',​ ''​phy0assoc'',​ ''​phy0radio''​ or ''​phy0tpt''​ | | ''​trigger''​ | string | yes | //(none)// | ''​phy0rx'',​ ''​phy0tx'',​ ''​phy0assoc'',​ ''​phy0radio''​ or ''​phy0tpt''​ |
Line 138: Line 158:
  
 The LED turns ON if USB device is connected. The LED turns ON if USB device is connected.
 +<code bash>​opkg install kmod-ledtrig-usbdev</​code>​
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
-| ''​sysfs''​ | string ​yes //​(none)// ​| LED device name | +| ''​default''​ | integer ​no | LED state before trigger: ​''​0'' ​means OFF and ''​1'' ​means ON |
-''​trigger'' ​| string | yes | //(none)// | ''​usbdev''​ |+
 | ''​dev''​ | string | yes | //(none)// | Name of USB device to monitor (in this example '​1-1'​). | | ''​dev''​ | string | yes | //(none)// | Name of USB device to monitor (in this example '​1-1'​). |
 | ''​interval''​ | integer | yes | //(none)// | Interval in ms when device is active. | | ''​interval''​ | integer | yes | //(none)// | Interval in ms when device is active. |
 +| ''​sysfs''​ | string | yes | //(none)// | LED device name |
 +| ''​trigger''​ | string | yes | //(none)// | ''​usbdev''​ |
  
 To find out device name use ''​logread''​ to search for it or list ''/​sys/​bus/​usb/​devices''​ (for this example, there would be ''/​sys/​bus/​usb/​devices/​1-1''​ device). To find out device name use ''​logread''​ to search for it or list ''/​sys/​bus/​usb/​devices''​ (for this example, there would be ''/​sys/​bus/​usb/​devices/​1-1''​ device).
Line 151: Line 173:
  
 Requires the kmod-ledtrig-morse package. UCI configuration was added in revision r34380. Requires the kmod-ledtrig-morse package. UCI configuration was added in revision r34380.
 +<code bash>​opkg install kmod-ledtrig-morse</​code>​
  
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
-| ''​sysfs''​ | string ​yes //​(none)// ​| LED device name +| ''​default''​ | integer ​no | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON 
-| ''​trigger''​ | string ​yes //​(none)// ​''​morse'' ​|+| ''​delay''​ | integer ​no 150 Dit length in milliseconds ​|
 | ''​dev''​ | string | yes | //(none)// | Name of USB device to monitor (in this example '​1-1'​). | | ''​dev''​ | string | yes | //(none)// | Name of USB device to monitor (in this example '​1-1'​). |
 | ''​message''​ | string | no | //(none)// | The message to signal | | ''​message''​ | string | no | //(none)// | The message to signal |
-| ''​delay''​ | integer ​no 150 Dit length in milliseconds ​|+| ''​sysfs''​ | string ​yes //​(none)// ​LED device name | 
 +| ''​trigger''​ | string | yes | //(none)// | ''​morse'' ​|
  
 If you don't have a recent enough version, you can set trigger to "​morse"​ and control the behavior by writing to the ''​message''​ and ''​delay''​ files in ''/​sys/​class/​leds/<​name>''​. If you don't have a recent enough version, you can set trigger to "​morse"​ and control the behavior by writing to the ''​message''​ and ''​delay''​ files in ''/​sys/​class/​leds/<​name>''​.
 +
 +=== GPIO ===
 +
 +Allows LEDs to be controlled by gpio events.
 +<code bash>​opkg install kmod-ledtrig-gpio</​code>​
 +^ Name ^ Type ^ Required ^ Default ^ Description ^
 +| ''​default''​ | integer | no | 0 | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON |
 +FIXME
 +
 +=== Net filter ===
 +
 +Flash LED when a particular packets passing through your machine.
 + 
 +For example to create an LED trigger for incoming SSH traffic:
 +<code bash>​iptables -A INPUT -p tcp --dport 22 -j LED --led-trigger-id ssh --led-delay 1000</​code>​
 +Then attach the new trigger to an LED on your system:
 +<code bash>​echo netfilter-ssh > /​sys/​class/​leds/<​ledname>/​trigger</​code>​
 +
 +<code bash>​opkg install kmod-ledtrig-netfilter</​code>​
 +^ Name ^ Type ^ Required ^ Default ^ Description ^
 +| ''​default''​ | integer | no | 0 | LED state before trigger: ''​0''​ means OFF and ''​1''​ means ON |
 +FIXME
  
 ===== Examples ===== ===== Examples =====
doc/uci/system.1353865343.txt.bz2 · Last modified: 2012/11/25 18:42 by encukou