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 |
test Xml.cdata get cdata1 = { "#CDATA" = "testing" }
let cdata1 = "<![CDATA[testing]]>"
let chainloader = [ command "chainloader" "\t" . [ spc . switch "force" ]? . spc . store Rx.no_spaces . eol ]
A list of variables to clear /!\ The manpage is not clear on the syntax
let clear = let name = [ label "name" . store name_re_colons ] in [ indent . key "#clear" . Sep.space . Build.opt_list name Sep.space . eol ]
let client = let user = [ label "user" . store Rx.word . Util.del_str "@" ] in [ label "client" . user? . store Rx.word ]
A list of clients
let client_list = Build.opt_list client comma
Function for simple key/value setting commands such as rootfs
let cmd_kv (cmd:string) (value:regexp) = Build.key_value_line cmd sep_colon (store value)
The moddir command for specifying module search paths
let cmd_moddir = Build.key_value_line "moddir" sep_colon (Build.opt_list modpath sep_moddir)
The set command for individual kernel/module parameters
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 ]
Cmnd_Alias, see alias_field
let cmnd_alias = alias_entry "Cmnd_Alias" "command" sto_to_com_cmnd
Command specification for spec, with optional runas_spec and any amount of tag_specs
let cmnd_spec = [ label "command" . runas_spec? . tag_spec* . sto_to_com_cmnd ]
A list of comma-separated cmnd_specs
let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*
this is the standard field separator “ : “
let colon = del (Rx.opt_space . ":" . Rx.opt_space) " : "
Separation between the alias and it’s destinations
let colon = del /[ \t]*:[ \t]+/ ":\t"
let colon = del /[ \t]*:[ \t]*/ ": "
let colon = Util.del_str ":"
Deletes a colon and default to it
let colon = sep_tab_opt . Util.del_str ":" . sep_tab_opt
let color =
let comma = Sep.comma
Separation between multiple destinations
let comma = del /[ \t]*,[ \t]*(\n[ \t]+)?/ ", "
let comma = del /([ \t]|(\\\\\n))*,([ \t]|(\\\\\n))*/ ", "
let comma = Util.del_str ","
Deletes a comma and default to it
let comma = sep_tab_opt . Util.del_str "," . sep_tab_opt
A comma separated list of options (opt=value or opt)
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 command can contain spaces, if enclosed in double quotes, the case without spaces is taken care with word
let command = /(\|([^", \t\n]+|"[^"\n]+"))|("\|[^"\n]+")/
let command (kw:regexp) (indent:string) = Util.del_opt_ws indent . key kw
nrpe.cfg usually has many entries defining commands to run
let command = let obrkt = del /\[/ "[" in let cbrkt = del /\]/ "]" in [ key "command" . [ obrkt . key /[^]\/\n]+/ . cbrkt . eq . store /[^\n]+/ . del /\n/ "\n" ] ]
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 ]
A comment, either comment_simple or comment_multi
let comment = comment_simple | 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 ]
Map comments into “#comment” nodes
let comment (pat:regexp) (default:string) = [ label "#comment" . sep pat default . sto_to_eol? . eol ]
Map comments in “#comment” nodes
let comment = Util.comment_generic /[ \t]*[#!][ \t]*/ "# "
let comment = IniFile.comment IniFile.comment_re IniFile.comment_default
let comment = Util.comment
Nrpe comments must start at beginning of line
let comment = Util.comment_generic /#[ \t]*/ "# "
let comment = Util.comment
let comment = Util.comment_generic /[ \t]*[;#][ \t]*/ "# "
An IniFile.comment entry
let comment = IniFile.comment "#" "#"
let comment = Util.comment_generic /[ \t]*\*[ \t]*/ "* "
Map comments in “#comment” nodes
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 into “#comment” nodes Can’t use Util.comment as #+ and #!
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n+!-].*[^ \t\n]|[^ \t\n+!-])/ . eol ]
Comments get mapped into “#comment” nodes.
test Xml.comment get "<!-- declarations for <head> & <body> -->" = { "#comment" = " declarations for <head> & <body> " }
Map comments into “#comment” nodes
let comment = comment_generic /[ \t]*#[ \t]*/ "# "
let comment = Util.comment
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 ";" ";"
A comment line, C-style
let comment_c_style = comment_generic /[ \t]*\/\/[ \t]*/ "// "
Default value for comment pattern
let comment_default = ";"
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 = Util.comment_generic /[ \t]+#[ \t]*/ " # "
Map eol comments into “#comment” nodes Add a space before # for end of line comments
let comment_eol = comment_generic /[ \t]*#[ \t]*/ " # "
Map comments and set default comment sign
let comment_generic (r:regexp) (d:string) = [ label "#comment" . del r d . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
A multiline comment, C-style
let comment_multi = Util.comment_multiline
A C-style multiline comment
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 comment_eol or eol
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, with an optional empty comment
let comment_or_eol = comment_eol | (del /[ \t]*(#[ \t]*)?\n/ "\n")
let comment_re = /([^ \t\n].*[^ \t\n]|[^ \t\n])/ - /# ## (Start|End) Default Options ##/
Default regexp for comment pattern
let comment_re = /[;#]/
A one-line comment, C-style
let comment_simple = Util.comment_c_style
Entries shared between defaults and fs_types sections
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
a comparison is an optional !
let comparison = /(!|[<=>]+|![<=>]+)/
A condition is an ‘and’ node, representing a union of condition_fields, listed under ‘or’ subnodes:
let condition = logic_construct_condition "or" condition_field
A single condition field is an ‘or’ node.
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 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_list = store "*" | logic_construct_condition "and" condition
let condition_re = "source" | "byhand" | "sections" | "binaries" | "architectures"
A full configuration
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 file
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
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 "
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
Another full configuration
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\" "
let configfile = [ command "configfile" "\t" . spc . store Rx.no_spaces . eol ]
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 ]
let ctrl_key = /[^ \t\n\/]+/
let ctrl_value = /[^ \t\n]+/