| M | |
| map_names, Nslcd | |
| meta_release, Test_Apt_Update_Manager | |
| minimal_toml | |
| minus, Test_Tmpfiles | |
| minus_tree, Test_Tmpfiles | |
| misc_check, Test_Keepalived | |
| mode_colon, Test_Tmpfiles | |
| mode_colon_tree, Test_Tmpfiles | |
| mode3, Test_Tmpfiles | |
| mode3_tree, Test_Tmpfiles | |
| mount_option, FAI_DiskConfig | |
| mount_option_value, FAI_DiskConfig | |
| mount_options, FAI_DiskConfig | |
| mountpoint, FAI_DiskConfig | |
| mountpoint_kw, FAI_DiskConfig | |
| multi, Test_Systemd | |
| multi_value_field, Aptsources822 | |
| multi_value_field_name, Aptsources822 | |
| multiline_ace, Test_IniFile | |
| multiline_nl, Test_IniFile | |
| multiline_test, Test_IniFile | |
| N | |
| name | |
| name_value_separator, Aptsources822 | |
| neg1, Rx | |
| new_conf | |
| no_space, Chrony | |
| no_spaces, Rx | |
| nocomma, Test_Aliases | |
| ntp_source, Chrony | |
| num, Cron | |
| number, Chrony | |
| number_re, Postgresql | |
| O | |
| octal, Rx | |
| opt_hash, Syslog | |
| opt_plus, Syslog | |
| opt_space | |
| opt_tab, Sep | |
| option, FAI_DiskConfig | |
| option_kw, Hosts_Access | |
| options, Test_Authorized_Keys | |
| optval, Crypttab | |
| P | |
| partition, FAI_DiskConfig | |
| path, Chrony | |
| percent, Test_Tmpfiles | |
| percent_tree, Test_Tmpfiles | |
| period_name_re, Anacron | |
| phony_conf, Test_Semanage | |
| pipe, Syslog | |
| plus, Syslog | |
| protocol, Syslog | |
| Q | |
| qpidc, Test_Qpid | |
| qpidd, Test_Qpid | |
| quote, Quote | |
| quote_opt, Quote | |
| quote_opt_nil, Quote | |
| quoted_non_empty_string_val, Xorg | |
| quoted_string_val, Xorg |
let map_names = /alias(es)?/ | /ether(s)?/ | /group/ | /host(s)?/ | /netgroup/ | /network(s)?/ | /passwd/ | /protocol(s)?/ | /rpc/ | /service(s)?/ | /shadow/
let meta_release = "# default location for the meta-release file [METARELEASE] URI = http://changelogs.ubuntu.com/meta-release URI_LTS = http://changelogs.ubuntu.com/meta-release-lts URI_UNSTABLE_POSTFIX = -development URI_PROPOSED_POSTFIX = -proposed "
let minimal_toml = "[root] foo = \"bar\" "
Example with an minus mark in the type
let minus = "D- /tmp/foo - - - - -\n"
Tree for minus_tree
let minus_tree = { "1" { "type" = "D-" } { "path" = "/tmp/foo" } { "mode" = "-" } { "uid" = "-" } { "gid" = "-" } { "age" = "-" } { "argument" = "-" } }
An example of a MISC health checker
let misc_check = "virtual_server 192.168.1.11 22 { real_server 10.20.40.10 22 { MISC_CHECK { misc_path /usr/local/bin/server_test misc_timeout 3 misc_dynamic } } } " test Keepalived.lns get misc_check = { "virtual_server" { "ip" = "192.168.1.11" } { "port" = "22" } { "real_server" { "ip" = "10.20.40.10" } { "port" = "22" } { "MISC_CHECK" { "misc_path" = "/usr/local/bin/server_test" } { "misc_timeout" = "3" } { "misc_dynamic" } } } }
Mode field with colon prefix
let mode_colon = "d- /root :0700 root :root\n"
Tree for mode_colon
let mode_colon_tree = { "1" { "type" = "d-" } { "path" = "/root" } { "mode" = ":0700" } { "uid" = "root" } { "gid" = ":root" } }
Mode field example with only three digits
let mode3 = "c+! /tmp/foo 755\n"
Tree for mode3
let mode3_tree = { "1" { "type" = "c+!" } { "path" = "/tmp/foo" } { "mode" = "755" } }
Counting options
let mount_option = [ seq "mount_option" . store /[^,= \t\n]+/ . mount_option_value? ]
let mount_option_value = [ label "value" . Util.del_str "=" . store /[^,= \t\n]+/ ]
An array of mount_options
let mount_options = [ label "mount_options" . counter "mount_option" . Build.opt_list mount_option Sep.comma ]
let mountpoint_kw = "-" (* do not mount *) | "swap" (* swap space *)
let multi = "[Unit] After=syslog.target network.target Also=canberra-system-shutdown.service canberra-system-shutdown-reboot.service Before=sysinit.target shutdown.target CapabilityBoundingSet=CAP_SYS_ADMIN CAP_SETUID CAP_SETGID Conflicts=emergency.service emergency.target ControlGroup=%R/user/%I/shared cpu:/ ListenNetlink=kobject-uevent 1 Requires=shutdown.target umount.target final.target Sockets=udev-control.socket udev-kernel.socket WantedBy=halt.target poweroff.target Wants=local-fs.target swap.target Wants=local-fs.target \ swap.target Wants=local-fs.target\ swap.target Wants= local-fs.target "
Lens for a field (field name, separator and field value) with multiple values or can run over multiple lines, ie.
let multi_value_field = [ key multi_value_field_name . name_value_separator . ( ( counter "item" . [ seq "item". store field_value . del /[ \t]+/ " " ]* . [ seq "item". store field_value ] . Util.doseol ) | ( [ label "text" . del "\n" "\n" . counter "item" . [ del /^[ ]/ " " . seq "item" . store text_value . Util.doseol ]+ ] ) ) ]
Names of known fields for which multiple values are allowed and are assumed to contain multiple values These fields also allow the form FieldName-Add: extra_value FieldName-Remove: delete_this_value This is an explicit list of allowed field names
let multi_value_field_name = /(URIs|Types|Components|Suites|Architectures|Include|Exclude|Languages|Targets|Signed-By)(-Add|-Remove)?/
let multiline_ace = IniFile.entry_multiline IniFile.entry_re sep_ace comment_ace
let multiline_nl = "test_ace =\n val2\n val3\n"
let multiline_test = "test_ace = val1\n val2\n val3\n"
let name = /([^ \t\n#:|@]+|"[^"|\n]*")/ (* " make emacs calm down *)
let name = /[^@%# \t\n][^ \t\n]*/
LVM volume group name
let name = [ label "name" . store /[^\/ \t\n]+/ ]
Lens for separating a name and value.
let name_value_separator = Sep.colon . del Rx.opt_space " "
Anything but a space, a comma or a comment sign
let neg1 = /[^,# \n\t]+/
let new_conf = " ACTIVEMQ_HOME=/usr/local/share/activemq ACTIVEMQ_BASE=${ACTIVEMQ_HOME} "
let new_conf = "<beans> <broker xmlns=\"http://activemq.apache.org/schema/core\" brokerName=\"localhost\" dataDirectory=\"${activemq.data}\"> <transportConnectors> <transportConnector name=\"openwire\" uri=\"tcp://127.0.0.1:61616\"/> </transportConnectors> </broker> </beans> "
let new_conf = "### Comment admin: password, admin "
let new_conf = "# Comment admin readonly "
let new_conf = "# Comment admin password "
let new_conf = "CLOUD_DOMAIN=\"rhcloud.com\" VALID_GEAR_SIZES=\"small,medium\" DEFAULT_MAX_GEARS=\"100\" DEFAULT_GEAR_CAPABILITIES=\"small\" DEFAULT_GEAR_SIZE=\"small\" MONGO_HOST_PORT=\"localhost:27017\" MONGO_USER=\"openshift\" MONGO_PASSWORD=\"mooo\" MONGO_DB=\"openshift_broker_dev\" MONGO_SSL=\"false\" ENABLE_USAGE_TRACKING_DATASTORE=\"false\" ENABLE_USAGE_TRACKING_AUDIT_LOG=\"false\" USAGE_TRACKING_AUDIT_LOG_FILE=\"/var/log/openshift/broker/usage.log\" ENABLE_ANALYTICS=\"false\" ENABLE_USER_ACTION_LOG=\"true\" USER_ACTION_LOG_FILE=\"/var/log/openshift/broker/user_action.log\" AUTH_PRIVKEYFILE=\"/etc/openshift/server_priv.pem\" AUTH_PRIVKEYPASS=\"\" AUTH_PUBKEYFILE=\"/etc/openshift/server_pub.pem\" AUTH_RSYNC_KEY_FILE=\"/etc/openshift/rsync_id_rsa\" AUTH_SCOPE_TIMEOUTS=\"session=1.days|7.days, *=1.months|6.months\" ENABLE_MAINTENANCE_MODE=\"false\" MAINTENANCE_NOTIFICATION_FILE=\"/etc/openshift/outage_notification.txt\" DOWNLOAD_CARTRIDGES_ENABLED=\"false\" "
let new_conf = "Listen 127.0.0.1:8080 User nobody Group apache include /etc/httpd/conf.d/ruby193-passenger.conf PassengerUser apache PassengerMaxPoolSize 80 PassengerMinInstances 2 PassengerPreStart http://127.0.0.1:8080/ PassengerUseGlobalQueue off RackBaseURI /broker PassengerRuby /var/www/openshift/broker/script/broker_ruby <Directory /var/www/openshift/broker/httpd/root/broker> Options -MultiViews </Directory> "
let new_conf = "[ {\"quickstart\": { \"id\": \"1\", \"name\":\"CakePHP\", \"website\":\"http://cakephp.org/\", \"initial_git_url\":\"git://github.com/openshift/cakephp-example.git\", \"cartridges\":[\"php-5.4\",\"mysql-5.1\"], \"summary\":\"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\", \"tags\":[\"php\",\"cakephp\",\"framework\"], \"admin_tags\":[] }}, {\"quickstart\": { \"id\": \"2\", \"name\":\"Django\", \"website\":\"https://www.djangoproject.com/\", \"initial_git_url\":\"git://github.com/openshift/django-example.git\", \"cartridges\":[\"python-2.7\"], \"summary\":\"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\", \"tags\":[\"python\",\"django\",\"framework\"], \"admin_tags\":[] }}, {\"quickstart\":{ \"id\": \"4\", \"name\":\"Drupal\", \"website\":\"http://drupal.org/\", \"initial_git_url\":\"git://github.com/openshift/drupal-example.git\", \"cartridges\":[\"php-5.4\",\"mysql-5.1\"], \"summary\":\"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\", \"tags\":[\"php\",\"drupal\",\"wiki\",\"framework\",\"instant_app\"], \"admin_tags\":[] }}, {\"quickstart\":{ \"id\": \"6\", \"name\":\"Ruby on Rails\", \"website\":\"http://rubyonrails.org/\", \"initial_git_url\":\"git://github.com/openshift/rails-example.git\", \"cartridges\":[\"ruby-1.9\",\"mysql-5.1\"], \"summary\":\"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\", \"tags\":[\"ruby\",\"rails\",\"framework\"], \"admin_tags\":[] }}, {\"quickstart\":{ \"id\": \"8\", \"name\":\"WordPress\", \"website\":\"https://wordpress.org\", \"initial_git_url\":\"git://github.com/openshift/wordpress-example.git\", \"cartridges\":[\"php-5.4\",\"mysql-5.1\"], \"summary\":\"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\", \"tags\":[\"php\",\"wordpress\",\"blog\",\"framework\",\"instant_app\"], \"admin_tags\":[] }} ]"
No spaces or comment characters
let no_space = /[^ \t\r\n!;#%]+/
A string with no spaces
let no_spaces = /[^ \t\r\n]+/
Don’t have to have whitespace after a comma
let nocomma = "alias: target1,target2\n"
Server/Peer/Pool key names
let ntp_source = "server"|"peer"|"pool"
let num = /[0-9*][0-9\/,*-]*/
let number = integer | decimal | decimal . /[eE]/ . integer | hex
A relative decimal number, optionally with unit
let number_re = Rx.reldecimal . /[kMG]?B|[m]?s|min|h|d/?
An octal value
let octal = /0[0-7]+/
deletes an optional # sign
let opt_hash = del /#?/ ""
deletes an optional + sign
let opt_plus = del /\+?/ ""
An optional space or tab
let opt_space = /[ \t]*/
Deletes a Rx.opt_space and default to an empty string
let opt_space = del Rx.opt_space ""
Deletes a Rx.opt_space and default to a tab
let opt_tab = del Rx.opt_space "\t"
let option =
Since either an option or a shell command can be given, use an explicit list of known options to avoid misinterpreting a command as an option
let option_kw = "severity" | "spawn" | "twist" | "keepalive" | "linger" | "rfc931" | "banners" | "nice" | "setenv" | "umask" | "user" | /allow/i | /deny/i
let options = "# Example options no-pty ssh-dsa AAAA no-pty ssh-ed25519 AAAA no-pty,command=\"foo\" ssh-dsa AAAA no-pty,command=\"foo bar\" ssh-dsa AAAA no-pty,from=\"example.com,10.1.1.0/16\" ssh-dsa AAAA no-pty,environment=\"LANG=en_GB.UTF8\" ssh-dsa AAAA "
let optval = /[A-Za-z0-9\/_@%.:-]+/
An optional partition number for disk
let partition = [ label "partition" . Util.del_str "." . store /[0-9]+/ ]
let path = Rx.fspath
Test with a percent sign
let percent = "m /var/log/%m 2755 root systemdjournal - -\n"
Tree for percent
let percent_tree = { "1" { "type" = "m" } { "path" = "/var/log/%m" } { "mode" = "2755" } { "uid" = "root" } { "gid" = "systemdjournal" } { "age" = "-" } { "argument" = "-" } }
The valid values for period_name.
let period_name_re = "monthly"
let phony_conf = "# this is a comment mykey = myvalue # eol comment anotherkey = another value "
Deletes a pipe and default to it
let pipe = Util.del_str "|"
Deletes a plus and default to it
let plus = Util.del_str "+"
means UDP means TCP
let protocol = /@{1,2}/
let qpidc = "# Configuration file for the qpid c++ client library. Entries are of # the form: # name=value ssl-cert-db=/root/certs/server_db ssl-port=5674 "
let qpidd = "# Configuration file for qpidd. Entries are of the form: # name=value # (Note: no spaces on either side of '='). Using default settings: # \"qpidd --help\" or \"man qpidd\" for more details. cluster-mechanism=ANONYMOUS auth=no max-connections=22000 syslog-name=qpidd1 "
A quote, either double or single, default to double
let quote = del /["']/ "\""
An optional quote, either double or single, default to double
let quote_opt = del /["']?/ "\""
An optional quote, either double or single, default to nothing
let quote_opt_nil = del /["']?/ ""
let quoted_non_empty_string_val = del "\"" "\"" . store /[^"\n]+/ . del "\"" "\""
let quoted_string_val = del "\"" "\"" . store /[^"\n]*/ . del "\"" "\""