Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
C
 CAVEATS, Sshd
 cdata, Test_Xml.Xml
 cdata1, Test_Xml
 cgconfig
 cgrules
 chainloader, Grub
 clear, AptConf
 client, Hosts_Access
 client_list, Hosts_Access
 cmd_kv, Solaris_System
 cmd_moddir, Solaris_System
 cmd_set, Solaris_System
 cmnd_alias, Sudoers
 cmnd_spec, Sudoers
 cmnd_spec_list, Sudoers
 colon
 color, Grub
 Columns definitions, Pg_Hba
 comma
 comma_sep_list
 command
 COMMANDS, Solaris_System
 comment
 Comment, Util
 comment_ace, Test_IniFile
 comment_acf, Test_IniFile
 comment_ade, Test_IniFile
 comment_adf, Test_IniFile
 comment_bce, Test_IniFile
 comment_bcf, Test_IniFile
 comment_bde, Test_IniFile
 comment_bdf, Test_IniFile
 comment_c_style, Util
 comment_default, IniFile
 comment_eol
 comment_generic, Util
 comment_multi, AptConf
 comment_multiline, Util
 comment_or_eol
 comment_re
 comment_simple, AptConf
 Comments, Test_Xml
 Comments and empty lines
 COMMON ENTRIES, Mke2fs
 common_entry, Mke2fs
 comparison, Syslog
 condition, Reprepro_Uploaders
 condition_field, Reprepro_Uploaders
 condition_list, Reprepro_Uploaders
 condition_re, Reprepro_Uploaders
 CONDITIONALS AND LOOPS, Shellvars
 conf
 conf_ace, Test_IniFile
 conf_acf, Test_IniFile
 conf_ade, Test_IniFile
 conf_adf, Test_IniFile
 conf_bce, Test_IniFile
 conf_bcf, Test_IniFile
 conf_bde, Test_IniFile
 conf_bdf, Test_IniFile
 config, Modprobe
 config1, Test_FAI_DiskConfig
 config2, Test_FAI_DiskConfig
 config3, Test_FAI_DiskConfig
 configfile, Grub
 Configuration files
 content, Test_Xml.Xml
 controller, cgrules
 CONTROLLER, cgrules
 Cron
 crypttab.aug
 ctrl_key, cgrules
 ctrl_value, cgrules
In sshd_config, Match blocks must be located at the end of the file.
test Xml.cdata get cdata1 = { "#CDATA" = "testing" }
let cdata1 = "<![CDATA[testing]]>"
Parses /etc/cgconfig.conf
Parses /etc/cgrules.conf
let chainloader = [ command "chainloader" "\t" . [ spc . switch "force" ]? . spc . store Rx.no_spaces . eol ]
let clear = let name = [ label "name" . store name_re_colons ] in [ indent . key "#clear" . Sep.space . Build.opt_list name Sep.space . eol ]
A list of variables to clear /!\ The manpage is not clear on the syntax
let client = let user = [ label "user" . store Rx.word . Util.del_str "@" ] in [ label "client" . user? . store Rx.word ]
let client_list = Build.opt_list client comma
A list of clients
let cmd_kv (cmd:string) (value:regexp) = Build.key_value_line cmd sep_colon (store value)
Function for simple key/value setting commands such as rootfs
let cmd_moddir = Build.key_value_line "moddir" sep_colon (Build.opt_list modpath sep_moddir)
The moddir command for specifying module search paths
let cmd_set = [ key "set" . Util.del_ws_spc . ( set_var | set_varmod ) . set_sep_spc . [ label "operator" . store set_operators ] . set_sep_spc . set_value . Util.eol ]
The set command for individual kernel/module parameters
let cmnd_alias = alias_entry "Cmnd_Alias" "command" sto_to_com_cmnd
Cmnd_Alias, see alias_field
let cmnd_spec = [ label "command" . runas_spec? . tag_spec* . sto_to_com_cmnd ]
Command specification for spec, with optional runas_spec and any amount of tag_specs
let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*
A list of comma-separated cmnd_specs
let colon = del (Rx.opt_space . ":" . Rx.opt_space) " : "
this is the standard field separator “ : “
let colon = del /[ \t]*:[ \t]+/ ":\t"
Separation between the alias and it’s destinations
let colon = del /[ \t]*:[ \t]*/ ": "
let colon = Util.del_str ":"
let colon = sep_tab_opt . Util.del_str ":" . sep_tab_opt
Deletes a colon and default to it
let color =
let comma = Sep.comma
let comma = del /[ \t]*,[ \t]*(\n[ \t]+)?/ ", "
Separation between multiple destinations
let comma = del /([ \t]|(\\\\\n))*,([ \t]|(\\\\\n))*/ ", "
let comma = Util.del_str ","
let comma = sep_tab_opt . Util.del_str "," . sep_tab_opt
Deletes a comma and default to it
let comma_sep_list (l:string) = let value = [ label "value" . Util.del_str "=" . store optval ] in let lns = [ label l . store word . value? ] in Build.opt_list lns comma
A comma separated list of options (opt=value or opt)
let command = /(\|([^", \t\n]+|"[^"\n]+"))|("\|[^"\n]+")/
a command can contain spaces, if enclosed in double quotes, the case without spaces is taken care with word
let command (kw:regexp) (indent:string) = Util.del_opt_ws indent . key kw
let command = let obrkt = del /\[/ "[" in let cbrkt = del /\]/ "]" in [ key "command" . [ obrkt . key /[^]\/\n]+/ . cbrkt . eq . store /[^\n]+/ . del /\n/ "\n" ] ]
nrpe.cfg usually has many entries defining commands to run
let comment = Util.comment
let comment = Util.comment
let comment = Util.comment
let comment = [ indent . label "#comment" . del /[#;][ \t]*/ "# " . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
let comment = comment_simple | comment_multi
A comment, either comment_simple or comment_multi
let comment = Util.comment
let comment = Util.comment
let comment = Util.comment
let comment = [ Util.indent . label "#comment" . del /#[ \t]*/ "# " . store comment_re . eol ]
let comment (pat:regexp) (default:string) = [ label "#comment" . sep pat default . sto_to_eol? . eol ]
Map comments into “#comment” nodes
let comment = Util.comment_generic /[ \t]*[#!][ \t]*/ "# "
Map comments in “#comment” nodes
let comment = IniFile.comment IniFile.comment_re IniFile.comment_default
let comment = Util.comment
let comment = Util.comment_generic /#[ \t]*/ "# "
Nrpe comments must start at beginning of line
let comment = Util.comment
let comment = Util.comment_generic /[ \t]*[;#][ \t]*/ "# "
let comment = IniFile.comment "#" "#"
An IniFile.comment entry
let comment = Util.comment_generic /[ \t]*\*[ \t]*/ "* "
let comment = let sto_to_eol = store (/([^ \t\n].*[^ \t\n]|[^ \t\n])/ - /include(dir)?.*/) in [ label "#comment" . del /[ \t]*#[ \t]*/ "# " . sto_to_eol . eol ]
Map comments in “#comment” nodes
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n+!-].*[^ \t\n]|[^ \t\n+!-])/ . eol ]
Map comments into “#comment” nodes Can’t use Util.comment as #+ and #! 
test Xml.comment get "<!-- declarations for <head> & <body> -->" = { "#comment" = " declarations for <head> & <body> " }
Comments get mapped into “#comment” nodes.
let comment = comment_generic /[ \t]*#[ \t]*/ "# "
Map comments into “#comment” nodes
let comment = Util.comment
This is a general definition of comment It allows indentation for comments, removes the leading and trailing spaces of comments and stores them in nodes, except for empty comments which are ignored together with empty lines
let comment_ace = IniFile.comment IniFile.comment_re IniFile.comment_default
let comment_acf = IniFile.comment IniFile.comment_re IniFile.comment_default
let comment_ade = IniFile.comment ";" ";"
let comment_adf = IniFile.comment ";" ";"
let comment_bce = IniFile.comment IniFile.comment_re IniFile.comment_default
let comment_bcf = IniFile.comment IniFile.comment_re IniFile.comment_default
let comment_bde = IniFile.comment ";" ";"
let comment_bdf = IniFile.comment ";" ";"
let comment_c_style = comment_generic /[ \t]*\/\/[ \t]*/ "// "
A comment line, C-style
let comment_default = ";"
Default value for comment pattern
let comment_eol = Util.comment_generic /[ \t]*[#!][ \t]*/ " # "
Map comments at eol
let comment_eol = Util.comment_generic /[ \t]*[;#][ \t]*/ " # "
let comment_eol = Util.comment_generic /[ \t]+#[ \t]*/ " # "
Requires a space before the #
let comment_eol = comment_generic /[ \t]*#[ \t]*/ " # "
Map eol comments into “#comment” nodes Add a space before # for end of line comments
let comment_generic (r:regexp) (d:string) = [ label "#comment" . del r d . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
Map comments and set default comment sign
let comment_multi = Util.comment_multiline
A multiline comment, C-style
let comment_multiline = let mline_re = (/[^ \t\n].*[^ \t\n]|[^ \t\n]/ - /.*\*\/.*/) in let mline = [ seq "mline" . del /[ \t\n]*/ "\n" . store mline_re ] in [ label "#mcomment" . del /[ \t]*\/\*/ "/*" . counter "mline" . mline . (eol . mline)* . del /[ \t\n]*\*\/[ \t]*\n/ "\n*/\n" ]
A C-style multiline comment
let comment_or_eol = comment_eol | (del /[ \t]*[#!]?\n/ "\n")
A comment_eol or eol
let comment_or_eol = comment_eol | (del /([ \t]+#\n|[ \t]*\n)/ "\n")
A comment_eol or eol
let comment_or_eol = comment_eol | (del /[ \t]*(#[ \t]*)?\n/ "\n")
A comment_eol or eol, with an optional empty comment
let comment_re = /([^ \t\n].*[^ \t\n]|[^ \t\n])/ - /# ## (Start|End) Default Options ##/
let comment_re = /[;#]/
Default regexp for comment pattern
let comment_simple = Util.comment_c_style
A one-line comment, C-style
let common_entry = list_sto ("base_features"|"default_features") (key Rx.word) | entry_sto "blocksize" ("-"? . Rx.integer) | entry_sto "hash_alg" ("legacy"|"half_md4"|"tea") | entry_sto ("inode_ratio"|"inode_size") Rx.integer
Entries shared between defaults and fs_types sections
let comparison = /(!|[<=>]+|![<=>]+)/
a comparison is an optional !
let condition = logic_construct_condition "or" condition_field
A condition is an ‘and’ node, representing a union of condition_fields, listed under ‘or’ subnodes:
let condition_field = let sto_condition = Util.del_str "'" . store /[^'\n]+/ . Util.del_str "'" in [ key "not" . Sep.space ]? . store condition_re . [ Sep.space . key "contain" ]? . Sep.space . logic_construct_field "or" "|" sto_condition
A single condition field is an ‘or’ node.
let condition_list = store "*" | logic_construct_condition "and" condition
A list of conditions, inspired by Debctrl.dependency_list An upload condition list is either the wildcard ‘*’, stored verbatim, or an intersection of conditions listed under ‘and’ subnodes:
let condition_re = "source" | "byhand" | "sections" | "binaries" | "architectures"
let conf = "+ : ALL : LOCAL + : root : localhost.localdomain - : root : 127.0.0.1 .localdomain + : root alice@server1 @admins (wheel) : cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6 # IP v6 support + : john foo : 2001:4ca0:0:101::1 2001:4ca0:0:101::/64 # Except + : ALL EXCEPT john @wheel : ALL EXCEPT LOCAL .win.tue.nl # No spaces +:root:.example.com "
A full configuration
let conf = "! This is a comment ! Configuration File for keepalived global_defs { ! this is who emails will go to on alerts notification_email { admins@example.com fakepager@example.com ! add a few more email addresses here if you would like } notification_email_from admins@example.com smtp_server 127.0.0.1 ! I use the local machine to relay mail smtp_connect_timeout 30 ! each load balancer should have a different ID ! this will be used in SMTP alerts, so you should make ! each router easily identifiable lvs_id LVS_EXAMPLE_01 } vrrp_sync_group VG1 { group { inside_network # name of vrrp_instance (below) outside_network # One for each moveable IP. } } vrrp_instance VI_1 { state MASTER interface eth0 track_interface { eth0 # Back eth1 # DMZ } track_script { check_apache2 # weight = +2 si ok, 0 si nok } garp_master_delay 5 priority 50 advert_int 2 authentication { auth_type PASS auth_pass mypass } virtual_ipaddress { 10.234.66.146/32 dev eth0 } lvs_sync_daemon_interface eth0 ha_suspend notify_master \"/svr/scripts/notify_master.sh\" notify_backup \"/svr/scripts/notify_backup.sh\" notify_fault \"/svr/scripts/notify_fault.sh\" ! each virtual router id must be unique per instance name! virtual_router_id 51 ! MASTER and BACKUP state are determined by the priority ! even if you specify MASTER as the state, the state will ! be voted on by priority (so if your state is MASTER but your ! priority is lower than the router with BACKUP, you will lose ! the MASTER state) ! I make it a habit to set priorities at least 50 points apart ! note that a lower number is lesser priority - lower gets less vote priority 150 ! how often should we vote, in seconds? advert_int 1 ! send an alert when this instance changes state from MASTER to BACKUP smtp_alert ! this authentication is for syncing between failover servers ! keepalived supports PASS, which is simple password ! authentication ! or AH, which is the IPSec authentication header. ! I don't use AH ! yet as many people have reported problems with it authentication { auth_type PASS auth_pass example } ! these are the IP addresses that keepalived will setup on this ! machine. Later in the config we will specify which real ! servers are behind these IPs ! without this block, keepalived will not setup and takedown the ! any IP addresses virtual_ipaddress { 192.168.1.11 10.234.66.146/32 dev vlan933 # parse it well ! and more if you want them } } virtual_server 192.168.1.11 22 { delay_loop 6 ! use round-robin as a load balancing algorithm lb_algo rr ! we are doing NAT lb_kind NAT nat_mask 255.255.255.0 protocol TCP ! there can be as many real_server blocks as you need real_server 10.20.40.10 22 { ! if we used weighted round-robin or a similar lb algo, ! we include the weight of this server weight 1 ! here is a health checker for this server. ! we could use a custom script here (see the keepalived docs) ! but we will just make sure we can do a vanilla tcp connect() ! on port 22 ! if it fails, we will pull this realserver out of the pool ! and send email about the removal TCP_CHECK { connect_timeout 3 connect_port 22 } } } virtual_server_group DNS_1 { 192.168.0.1 22 10.234.55.22-25 36 10.45.58.59/32 27 } vrrp_script chk_apache2 { # Requires keepalived-1.1.13 script \"killall -0 apache2\" # faster interval 2 # check every 2 seconds weight 2 # add 2 points of prio if OK } ! that's all "
A full configuration file
let conf = "# ftpmaster allow * by key 74BF771E allow sections 'desktop/*' by anybody allow sections 'gforge/*' and binaries contain 'bzr' or not source '*melanie*'|'katya' by any key "
A full configuration
let conf_ace = "# comment with sharp [section1] test_ace = value # end of line comment test_ace = ; comment with colon "
let conf_acf = "# comment with sharp [section1] test_acf = value test_acf = test_acf : value2 # end of line comment ; comment with colon "
let conf_ade = "; a first comment with colon [section1] test_ade = value test_ade : value2 ; end of line comment ; comment with colon test_ade = "
let conf_adf = "; a first comment with colon [section1] test_adf = value test_adf : value2 ; end of line comment ; comment with colon test_adf = "
let conf_bce = "# comment with sharp [section1] test_bce = value # end of line comment ; comment with colon test_bce = "
let conf_bcf = "# conf with sharp [section1] test_bcf = value # end of line comment ; comment with colon test_bcf = "
let conf_bde = "; first comment with colon [section1] test_bde = value ; end of line comment ; comment with colon test_bde = "
let conf_bdf = "; first comment with colon [section1] test_bdf = value ; end of line comment ; comment with colon test_bdf = "
let config = Build.key_value_line_comment "config" sep_space (store /binary_indexes|yes|no/) comment
let config1 = "disk_config disk1 bootable:1 preserve_always:all always_format:5,6,7,8,9,10,11 primary - 0 - - primary - 0 - - logical / 0 ext3 rw,relatime,errors=remount-ro createopts=\"-c -j\" logical swap 0 swap sw logical /var 0 ext3 rw,relatime createopts=\"-m 5 -j\" logical /tmp 0 ext3 rw createopts=\"-m 0 -j\" logical /usr 0 ext3 rw,relatime createopts=\"-j\" logical /home 0 ext3 rw,relatime,nosuid,nodev createopts=\"-m 1 -j\" logical /wrk 0 ext3 rw,relatime,nosuid,nodev createopts=\"-m 1 -j\" logical /transfer 0 vfat rw "
Another full configuration
let config2 = "disk_config /dev/sda primary - 250M - - primary - 20G - - logical - 8G - - logical - 4G - - logical - 5G - - disk_config /dev/sdb sameas:/dev/sda disk_config raid raid1 /boot sda1,sdb1 ext3 defaults raid1 / sda2,sdb2 ext3 defaults,errors=remount-ro raid1 swap sda5,sdb5 swap defaults raid1 /tmp sda6,sdb6 ext3 defaults createopts=\"-m 1\" raid1 /var sda7,sdb7 ext3 defaults "
Another full configuration
let config3 = "disk_config /dev/sdb primary / 21750 ext3 defaults,errors=remount-ro primary /boot 250 ext3 defaults logical - 4000 - - logical - 2000 - - logical - 10- - - disk_config cryptsetup randinit swap swap /dev/sdb5 swap defaults tmp /tmp /dev/sdb6 ext2 defaults luks /local00 /dev/sdb7 ext3 defaults,errors=remount-ro createopts=\"-m 0\" "
Another full configuration
let configfile = [ command "configfile" "\t" . spc . store Rx.no_spaces . eol ]
This lens applies to /etc/security/access.conf.
This lens applies to /etc/aliases.
This lens applies to /etc/approx/approx.conf.
This lens applies to /etc/apt/apt.conf and /etc/apt/apt.conf.d/*.
This lens applies to /etc/backuppc/hosts.
This lens applies to /etc/cgconfig.conf.
This lens applies to /etc/cgconfig.conf.
This lens applies to /etc/cron.d/* and /etc/crontab.
This lens applies to /etc/dhcpd3/dhcpd.conf.
This lens applies to /etc/host.conf.
This lens applies to /etc/hosts.{allow,deny}.
This lens applies to /etc/kdump.conf.
This lens applies to /etc/keepalived/keepalived.conf.
This lens applies to /etc/login.defs.
This lens applies to /etc/mke2fs.conf.
This lens applies to /etc/modprobe.conf and /etc/modprobe.d/*.
This lens applies to /etc/modules.
This lens applies to /etc/nagios3/*.cfg.
This lens applies to /etc/nagios3/objects/*.cfg.
This lens applies to /etc/networks.
This lens applies to /etc/nsswitch.conf.
This lens applies to /etc/pbuilderrc and /etc/pbuilder/pbuilderrc.
This lens applies to pg_hba.conf.
This lens applies to reprepro’s uploaders files.
This lens applies to /etc/resolv.conf.
This lens applies to /etc/schroot/schroot.conf.
This lens applies to /etc/services.
This lens applies to /etc/shells.
This lens applies to /etc/system on Solaris.
This lens applies to /etc/ssh/sshd_config
This lens applies to /etc/sudoers.
This lens applies to /etc/syslog.conf.
This lens applies to /etc/X11/xorg.conf.
test Xml.content put "<a><b/></a>" after clear "/a/b" = "<a><b></b>\n</a>"
let controller = ws . [ key ctrl_key . ws . store ctrl_value ]
Parses /etc/cron.d/*, /etc/crontab
let ctrl_key = /[^ \t\n\/]+/
let ctrl_value = /[^ \t\n]+/
Close