PATH:
usr
/
share
/
augeas
/
lenses
/
dist
(* Module: Systemd Parses systemd unit files. Author: Dominic Cleal <dcleal@redhat.com> About: Reference This lens tries to keep as close as possible to systemd.unit(5) and systemd.service(5) etc where possible. About: License This file is licenced under the LGPL v2+, like the rest of Augeas. About: Lens Usage To be documented About: Configuration files This lens applies to /lib/systemd/system/* and /etc/systemd/system/*. See <filter>. *) module Systemd = autoload xfm (************************************************************************ * Group: USEFUL PRIMITIVES *************************************************************************) (* View: eol *) let eol = Util.eol (* View: eol_comment An <IniFile.comment> entry for standalone comment lines (; or #) *) let comment = IniFile.comment IniFile.comment_re "#" (* View: eol_comment An <IniFile.comment> entry for end of line comments (# only) *) let eol_comment = IniFile.comment "#" "#" (* View: sep An <IniFile.sep> entry *) let sep = IniFile.sep "=" "=" (* Variable: entry_single_kw *) let entry_single_kw = "Description" (* Variable: entry_command_kw *) let entry_command_kw = /Exec[A-Za-z][A-Za-z0-9._-]+/ (* Variable: entry_env_kw *) let entry_env_kw = "Environment" (* Variable: entry_multi_kw *) let entry_multi_kw = let forbidden = entry_single_kw | entry_command_kw | entry_env_kw in /[A-Za-z][A-Za-z0-9._-]+/ - forbidden (* Variable: value_single_re *) let value_single_re = /[^# \t\n\\][^#\n\\]*[^# \t\n\\]|[^# \t\n\\]/ (* View: sto_value_single Support multiline values with a backslash *) let sto_value_single = Util.del_opt_ws "" . store (value_single_re . (/\\\\\n/ . value_single_re)*) (* View: sto_value *) let sto_value = store /[^# \t\n]*[^# \t\n\\]/ (* Variable: value_sep Multi-value entries separated by whitespace or backslash and newline *) let value_sep = del /[ \t]+|[ \t]*\\\\[ \t]*\n[ \t]*/ " " (* Variable: value_cmd_re Don't parse @ and - prefix flags *) let value_cmd_re = /[^#@ \t\n\\-][^#@ \t\n\\-][^# \t\n\\]*/ (* Variable: env_key *) let env_key = /[A-Za-z0-9_]+(\[[0-9]+\])?/ (************************************************************************ * Group: ENTRIES *************************************************************************) (* Supported entry features, selected by key names: * multi-value space separated attrs (the default) * single-value attrs (Description) * systemd.service: Exec* attrs with flags, command and arguments * systemd.service: Environment NAME=arg *) (* View: entry_fn Prototype for our various key=value lines, with optional comment *) let entry_fn (kw:regexp) (val:lens) = [ key kw . sep . val . (eol_comment|eol) ] (* View: entry_value Store a value that doesn't contain spaces *) let entry_value = [ label "value" . sto_value ] (* View: entry_single Entry that takes a single value containing spaces *) let entry_single = entry_fn entry_single_kw [ label "value" . sto_value_single ]? (* View: entry_command Entry that takes a space separated set of values (the default) *) let entry_multi = entry_fn entry_multi_kw ( Util.del_opt_ws "" . Build.opt_list entry_value value_sep )? (* View: entry_command_flags Exec* flags "@" and "-". Order is important, see systemd.service(8) *) let entry_command_flags = let exit = [ label "ignoreexit" . Util.del_str "-" ] in let arg0 = [ label "arg0" . Util.del_str "@" ] in exit? . arg0? (* View: entry_command Entry that takes a command, arguments and the optional prefix flags *) let entry_command = let cmd = [ label "command" . store value_cmd_re ] in let arg = [ seq "args" . sto_value ] in let args = [ counter "args" . label "arguments" . (value_sep . arg)+ ] in entry_fn entry_command_kw ( entry_command_flags . cmd . args? )? (* View: entry_env Entry that takes a space separated set of ENV=value key/value pairs *) let entry_env = let envkv (env_val:lens) = key env_key . Util.del_str "=" . env_val (* bare has no spaces, and is optionally quoted *) in let bare = Quote.do_quote_opt (envkv (store /[^#'" \t\n]*[^#'" \t\n\\]/)?) in let bare_dqval = envkv (store /"[^#" \t\n]*[^#" \t\n\\]"/) in let bare_sqval = envkv (store /'[^#' \t\n]*[^#' \t\n\\]'/) (* quoted has at least one space, and must be quoted *) in let quoted = Quote.do_quote (envkv (store /[^#"'\n]*[ \t]+[^#"'\n]*/)) in let envkv_quoted = [ bare ] | [ bare_dqval ] | [ bare_sqval ] | [ quoted ] in entry_fn entry_env_kw ( Build.opt_list envkv_quoted value_sep ) (************************************************************************ * Group: LENS *************************************************************************) (* View: entry An <IniFile.entry> *) let entry = entry_single | entry_multi | entry_command | entry_env | comment (* View: include Includes another file at this position *) let include = [ key ".include" . Util.del_ws_spc . sto_value . (eol_comment|eol) ] (* View: title An <IniFile.title> *) let title = IniFile.title IniFile.record_re (* View: record An <IniFile.record> *) let record = IniFile.record title (entry|include) (* View: lns An <IniFile.lns> *) let lns = IniFile.lns record (comment|include) (* View: filter *) let filter = incl "/lib/systemd/system/*" . incl "/lib/systemd/system/*/*" . incl "/etc/systemd/system/*" . incl "/etc/systemd/system/*/*" . incl "/etc/sysconfig/*.systemd" . Util.stdexcl let xfm = transform lns filter
[+]
..
[-] mailscanner.aug
[edit]
[-] access.aug
[edit]
[-] gshadow.aug
[edit]
[-] activemq_conf.aug
[edit]
[-] gtkbookmarks.aug
[edit]
[-] activemq_xml.aug
[edit]
[-] hostname.aug
[edit]
[-] afs_cellalias.aug
[edit]
[-] mcollective.aug
[edit]
[-] aliases.aug
[edit]
[-] mdadm_conf.aug
[edit]
[-] anacron.aug
[edit]
[-] memcached.aug
[edit]
[-] approx.aug
[edit]
[-] group.aug
[edit]
[-] phpvars.aug
[edit]
[-] apt_update_manager.aug
[edit]
[-] grub.aug
[edit]
[-] puppet.aug
[edit]
[-] aptcacherngsecurity.aug
[edit]
[-] mongodbserver.aug
[edit]
[-] aptconf.aug
[edit]
[-] host_conf.aug
[edit]
[-] aptpreferences.aug
[edit]
[-] hosts.aug
[edit]
[-] aptsources.aug
[edit]
[-] hosts_access.aug
[edit]
[-] authorized_keys.aug
[edit]
[-] htpasswd.aug
[edit]
[-] automaster.aug
[edit]
[-] jettyrealm.aug
[edit]
[-] automounter.aug
[edit]
[-] mke2fs.aug
[edit]
[-] avahi.aug
[edit]
[-] jaas.aug
[edit]
[-] backuppchosts.aug
[edit]
[-] modprobe.aug
[edit]
[-] bbhosts.aug
[edit]
[-] jmxaccess.aug
[edit]
[-] bootconf.aug
[edit]
[-] modules.aug
[edit]
[-] build.aug
[edit]
[-] jmxpassword.aug
[edit]
[-] cachefilesd.aug
[edit]
[-] modules_conf.aug
[edit]
[-] carbon.aug
[edit]
[-] json.aug
[edit]
[-] cgconfig.aug
[edit]
[-] nagiosobjects.aug
[edit]
[-] cgrules.aug
[edit]
[-] kdump.aug
[edit]
[-] channels.aug
[edit]
[-] monit.aug
[edit]
[-] chrony.aug
[edit]
[-] multipath.aug
[edit]
[-] clamav.aug
[edit]
[-] keepalived.aug
[edit]
[-] cobblermodules.aug
[edit]
[-] known_hosts.aug
[edit]
[-] cobblersettings.aug
[edit]
[-] koji.aug
[edit]
[-] collectd.aug
[edit]
[-] mysql.aug
[edit]
[-] cpanel.aug
[edit]
[-] nagioscfg.aug
[edit]
[-] cron.aug
[edit]
[-] krb5.aug
[edit]
[-] crypttab.aug
[edit]
[-] netmasks.aug
[edit]
[-] cups.aug
[edit]
[-] ldif.aug
[edit]
[-] cyrus_imapd.aug
[edit]
[-] networkmanager.aug
[edit]
[-] darkice.aug
[edit]
[-] networks.aug
[edit]
[-] debctrl.aug
[edit]
[-] nrpe.aug
[edit]
[-] desktop.aug
[edit]
[-] ldso.aug
[edit]
[-] device_map.aug
[edit]
[-] lightdm.aug
[edit]
[-] dhclient.aug
[edit]
[-] nginx.aug
[edit]
[-] dhcpd.aug
[edit]
[-] limits.aug
[edit]
[-] dhcpd_140.aug
[edit]
[-] login_defs.aug
[edit]
[-] dns_zone.aug
[edit]
[-] ntpd.aug
[edit]
[-] dnsmasq.aug
[edit]
[-] nsswitch.aug
[edit]
[-] dovecot.aug
[edit]
[-] ntp.aug
[edit]
[-] dpkg.aug
[edit]
[-] odbc.aug
[edit]
[-] dput.aug
[edit]
[-] openshift_http.aug
[edit]
[-] erlang.aug
[edit]
[-] openshift_config.aug
[edit]
[-] ethers.aug
[edit]
[-] pamconf.aug
[edit]
[-] exports.aug
[edit]
[-] logrotate.aug
[edit]
[-] fai_diskconfig.aug
[edit]
[-] openvpn.aug
[edit]
[-] fonts.aug
[edit]
[-] pagekite.aug
[edit]
[-] fstab.aug
[edit]
[-] pam.aug
[edit]
[-] fuse.aug
[edit]
[-] passwd.aug
[edit]
[-] gdm.aug
[edit]
[-] httpd.aug
[edit]
[-] postfix_access.aug
[edit]
[-] inetd.aug
[edit]
[-] pbuilder.aug
[edit]
[-] inifile.aug
[edit]
[-] pg_hba.aug
[edit]
[-] inittab.aug
[edit]
[-] pgbouncer.aug
[edit]
[-] inputrc.aug
[edit]
[-] logwatch.aug
[edit]
[-] interfaces.aug
[edit]
[-] lokkit.aug
[edit]
[-] iproute2.aug
[edit]
[-] mailscanner_rules.aug
[edit]
[-] iptables.aug
[edit]
[-] php.aug
[edit]
[-] iscsid.aug
[edit]
[-] lvm.aug
[edit]
[-] util.aug
[edit]
[-] openshift_quickstarts.aug
[edit]
[-] xinetd.aug
[edit]
[-] postfix_main.aug
[edit]
[-] xendconfsxp.aug
[edit]
[-] postfix_master.aug
[edit]
[-] vfstab.aug
[edit]
[-] postfix_sasl_smtpd.aug
[edit]
[-] vmware_config.aug
[edit]
[-] postfix_transport.aug
[edit]
[-] xml.aug
[edit]
[-] postfix_virtual.aug
[edit]
[-] xorg.aug
[edit]
[-] postgresql.aug
[edit]
[-] xymon.aug
[edit]
[-] properties.aug
[edit]
[-] xymon_alerting.aug
[edit]
[-] protocols.aug
[edit]
[-] yum.aug
[edit]
[-] puppet_auth.aug
[edit]
[-] puppetfile.aug
[edit]
[-] vsftpd.aug
[edit]
[-] puppetfileserver.aug
[edit]
[-] anaconda.aug
[edit]
[-] pylonspaste.aug
[edit]
[-] pythonpaste.aug
[edit]
[-] qpid.aug
[edit]
[-] quote.aug
[edit]
[-] rabbitmq.aug
[edit]
[-] redis.aug
[edit]
[-] webmin.aug
[edit]
[-] reprepro_uploaders.aug
[edit]
[-] resolv.aug
[edit]
[-] rhsm.aug
[edit]
[-] rmt.aug
[edit]
[-] rsyncd.aug
[edit]
[-] rsyslog.aug
[edit]
[-] rx.aug
[edit]
[-] samba.aug
[edit]
[-] schroot.aug
[edit]
[-] securetty.aug
[edit]
[-] sep.aug
[edit]
[-] services.aug
[edit]
[-] shadow.aug
[edit]
[-] shells.aug
[edit]
[-] shellvars.aug
[edit]
[-] shellvars_list.aug
[edit]
[-] simplelines.aug
[edit]
[-] simplevars.aug
[edit]
[-] sip_conf.aug
[edit]
[-] slapd.aug
[edit]
[-] slapd_140.aug
[edit]
[-] smbusers.aug
[edit]
[-] solaris_system.aug
[edit]
[-] soma.aug
[edit]
[-] spacevars.aug
[edit]
[-] splunk.aug
[edit]
[-] squid.aug
[edit]
[-] ssh.aug
[edit]
[-] sshd.aug
[edit]
[-] sshd_140.aug
[edit]
[-] sssd.aug
[edit]
[-] stunnel.aug
[edit]
[-] subversion.aug
[edit]
[-] sudoers.aug
[edit]
[-] sysconfig.aug
[edit]
[-] sysconfig_route.aug
[edit]
[-] sysctl.aug
[edit]
[-] syslog.aug
[edit]
[-] systemd.aug
[edit]
[-] thttpd.aug
[edit]
[-] tuned.aug
[edit]
[-] up2date.aug
[edit]
[-] updatedb.aug
[edit]
[-] wine.aug
[edit]