Commit 6609aaa6 authored by Lev Lamberov's avatar Lev Lamberov

New upstream version 1.6

parents
This diff is collapsed.
SRC = systemd.el
DATA = unit-directives.txt network-directives.txt nspawn-directives.txt
DISTFILES := Makefile $(SRC) $(DATA) LICENSE README systemd-pkg.el test
VERSION := $(shell awk '/^;; Version:/ {print $$3}' $(SRC))
PREFIX = /usr/local
datarootdir := $(PREFIX)/share
emacsdir := $(datarootdir)/emacs/site-lisp
EMACS = emacs
all: $(SRC:.el=.elc)
systemd-pkg.el: $(SRC)
printf "(define-package \"systemd\" \"%s\" " $(VERSION) > $@
echo "\"Major mode for editing systemd units\")" >> $@
systemd.elc: $(DATA)
check: test/systemd-tests.el systemd.elc
@$(EMACS) -Q --batch -L . --eval "(progn \
(load-file \"test/systemd-tests.el\") \
(ert-run-tests-batch-and-exit))"
clean:
$(RM) $(SRC:.el=.elc) systemd-pkg.el
dist: clean systemd-pkg.el
mkdir systemd-$(VERSION)
cp -r $(DISTFILES) systemd-$(VERSION)
tar cf systemd-$(VERSION).tar systemd-$(VERSION)
rm -rf systemd-$(VERSION)
install:
install -d $(DESTDIR)$(emacsdir)/systemd
install -m644 $(SRC) $(SRC:.el=.elc) -t $(DESTDIR)$(emacsdir)/systemd
install -m644 $(DATA) -t $(DESTDIR)$(emacsdir)/systemd
.el.elc:
$(EMACS) -L . --batch -f batch-byte-compile $<
.PHONY: all check clean dist install
systemd mode
============
Major mode for editing systemd units in GNU Emacs. See the commentary
in `systemd.el`.
Installation
------------
Available as the `systemd` package on MELPA <http://melpa.org/> and
marmalade <https://marmalade-repo.org/>.
In Emacs, one can locally install as a package with `make dist` and
M-x package-install-file RET /path/to/systemd-VERSION.tar RET
Otherwise, for either installing into one's `load-path` or a system
install, do the usual
make
make install
ARP
ARPAllTargets
ARPIPTargets
ARPIntervalSec
ARPValidate
ActiveSlave
AdSelect
Address
AgeingTimeSec
AllSlavesActive
AllowPortToBeRoot
Architecture
AutoJoin
AutoNegotiation
BindCarrier
BitsPerSecond
Bond
Bridge
Cache
ClientIdentifier
CopyDSCP
Cost
CriticalConnection
DHCP
DHCPServer
DNS
DNSSEC
DNSSECNegativeTrustAnchors
DNSStubListener
DUIDRawData
DUIDType
DefaultLeaseTimeSec
Description
DefaultPVID
Destination
DestinationPort
DiscoverPathMTU
Domains
DownDelaySec
Driver
Duplex
DuplicateAddressDetection
EgressUntagged
EmitDNS
EmitLLDP
EmitNTP
EmitRouter
EmitTimezone
EncapsulationLimit
FDBAgeingSec
FailOverMACPolicy
FallbackDNS
FallbackNTP
FastLeave
FlowLabel
ForwardDelaySec
GVRP
Gateway
GatewayOnlink
GenericReceiveOffload
GenericSegmentationOffload
GratuitousARP
GroupPolicyExtension
HairPin
HelloTimeSec
HomeAddress
Host
Hostname
IAID
IPForward
IPMasquerade
IPv4LLRoute
IPv4ProxyARP
IPv6AcceptRA
IPv6DuplicateAddressDetection
IPv6FlowLabel
IPv6HopLimit
IPv6Preference
IPv6PrivacyExtensions
IPv6ProxyNDP
IPv6ProxyNDPAddress
IPv6Token
Id
InputKey
KernelCommandLine
Key
Kind
L2MissNotification
L3MissNotification
LACPTransmitRate
LLDP
LLMNR
Label
LargeReceiveOffload
LearnPacketIntervalSec
LinkLocalAddressing
ListenPort
Local
LooseBinding
MACAddress
MACAddressPolicy
MACVLAN
MIIMonitorSec
MTUBytes
MVRP
MacLearning
ManageTemporaryAddress
MaxAgeSec
MaxLeaseTimeSec
MaximumFDBEntries
Metric
MinLinks
Mode
MultiQueue
MulticastDNS
MulticastQuerier
MulticastSnooping
NTP
Name
NamePolicy
OneQueue
OriginalName
OutputKey
PVID
PacketInfo
PacketsPerSlave
Path
Peer
PoolOffset
PoolSize
Port
PortRange
PreferredLifetime
PreferredSource
Prefix
PrefixRoute
PrimaryReselectPolicy
PrimarySlave
Protocol
ReduceARPProxy
Remote
RemoteChecksumRx
RemoteChecksumTx
ReorderHeader
RequestBroadcast
ResendIGMP
RouteMetric
RouteShortCircuit
RouteTable
STP
Scope
SendHostname
Source
TCPSegmentationOffload
TOS
TTL
Table
Timezone
TransmitHashPolicy
Tunnel
UDP6ZeroChecksumRx
UDP6ZeroChecksumTx
UDPChecksum
UDPSegmentationOffload
UnicastFlood
Unmanaged
UpDelaySec
UseBPDU
UseDNS
UseDomains
UseHostname
UseMTU
UseNTP
UseRoutes
UseTimezone
VLAN
VLANFiltering
VLANId
VNetHeader
VRF
VXLAN
VendorClassIdentifier
Virtualization
WakeOnLan
Boot
ProcessTwo
Parameters
Environment
User
WorkingDirectory
PivotRoot
Capability
KillSignal
Personality
MachineID
PrivateUsers
NotifyReady
ReadOnly
Volatile
Bind
TemporaryFileSystem
Overlay
PrivateUsersChown
Private
VirtualEthernet
VirtualEthernetExtra
Interface
MACVLAN
Bridge
Zone
Port
This diff is collapsed.
;;; systemd-tests.el --- Tests for systemd.el -*- lexical-binding: t -*-
;; Copyright (C) 2016-2017 Mark Oteiza <mvoteiza@udel.edu>
;; Author: Mark Oteiza <mvoteiza@udel.edu>
;; This file is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this file. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(require 'ert)
(require 'systemd)
(ert-deftest test-normal-autoloads ()
"Tests for `systemd-autoload-regexp'.
This should match unit names: alpha-numeric ascii base names,
with exceptions in the set [-_.@\\]. Extensions are a prescribed
list. Some from systemd.unit(5) are excluded intentionally;
e.g. scope files which are created programmatically."
(let ((re systemd-autoload-regexp))
(should (string-match-p re "70-snark-ethernet.link"))
(should-not (string-match-p re "abusname"))
(should-not (string-match-p re "busname"))
;; Do not match empty unit name
(should-not (string-match-p re ".service"))
;; Non-alphanumeric ASCII exceptions
(should (string-match-p re "-.mount"))
(should (string-match-p re "dev-dm\\x2d4.service"))
(should (string-match-p re "proc-sys-fs-binfmt_misc.automount"))
(should (string-match-p re "bitlbee@.service"))
(should (string-match-p re "org.freedesktop.timedate1.busname"))
;; Do not match non-ASCII
(should-not (string-match-p re "割り箸.service"))
;; Do not match non-alphanumeric ASCII
(should-not (string-match-p re "~.service"))))
(ert-deftest test-tempfile-autoloads ()
"Tests for `systemd-tempfn-autoload-regexp'.
Should match file names generated by \"tempfn_random\" in
src/basic/fileio.c which, to quote its comments, does the
transformation
/foo/bar/waldo => /foo/bar/.#<extra>waldobaa2a261115984a9
but not plain unit names. For temp files made from systemctl
edit, <extra> is NULL as of systemd 229."
(let ((re systemd-tempfn-autoload-regexp))
(should-not (string-match-p re "/foo/bar/.#waldobaa2a261115984a9"))
(should (string-match-p re ".#override.conf064d87263873e7f7"))
(should (string-match-p re ".#FOObar.timer064d87263873e7f7"))
;; Do not match just the conf extension or unit names
(should-not (string-match-p re "override.conf"))
(should-not (string-match-p re "mmmmm.mount"))))
(ert-deftest test-dropin-autoloads ()
"Tests for `systemd-dropin-autoload-regexp'.
It should match file names with the \".conf\" extension if and
only if in an appropriately named parent directory."
(let ((re systemd-dropin-autoload-regexp))
(should (string-match-p re "/systemd/dog.socket.d/woof.conf"))
(should-not (string-match-p re "foobar.conf"))
(should-not (string-match-p re "/etc/modprobe.d/bonding.conf"))
(should-not (string-match-p re "/etc/systemd/system.conf"))
;; No restrictions on the base name
(should (string-match-p re ".config/systemd/user/foo.timer.d/კულტის.conf"))
(should (string-match-p re "/etc/systemd/user/c.service.d/a\nb.conf"))
;; Do not match inside a subdirectory of foobar.d/
(should-not (string-match-p re ".config/systemd/user/foo.timer.d/a/b.conf"))))
(provide 'systemd-tests)
;;; systemd-tests.el ends here
Accept
AccuracySec
After
Alias
AllowIsolate
Also
AmbientCapabilities
AppArmorProfile
AssertACPower
AssertArchitecture
AssertCapability
AssertDirectoryNotEmpty
AssertFileIsExecutable
AssertFileNotEmpty
AssertFirstBoot
AssertGroup
AssertHost
AssertKernelCommandLine
AssertNeedsUpdate
AssertPathExists
AssertPathExistsGlob
AssertPathIsDirectory
AssertPathIsMountPoint
AssertPathIsReadWrite
AssertPathIsSymbolicLink
AssertSecurity
AssertUser
AssertVirtualization
Backlog
Before
BindIPv6Only
BindPaths
BindReadOnlyPaths
BindToDevice
BindsTo
BlockIOAccounting
BlockIODeviceWeight
BlockIOReadBandwidth
BlockIOWeight
BlockIOWriteBandwidth
Broadcast
BusName
CPUAccounting
CPUAffinity
CPUQuota
CPUSchedulingPolicy
CPUSchedulingPriority
CPUSchedulingResetOnFork
CPUShares
CPUWeight
CapabilityBoundingSet
ConditionACPower
ConditionArchitecture
ConditionCapability
ConditionDirectoryNotEmpty
ConditionFileIsExecutable
ConditionFileNotEmpty
ConditionFirstBoot
ConditionGroup
ConditionHost
ConditionKernelCommandLine
ConditionNeedsUpdate
ConditionPathExists
ConditionPathExistsGlob
ConditionPathIsDirectory
ConditionPathIsMountPoint
ConditionPathIsReadWrite
ConditionPathIsSymbolicLink
ConditionSecurity
ConditionUser
ConditionVirtualization
Conflicts
DefaultDependencies
DefaultInstance
DeferAcceptSec
Delegate
Description
DeviceAllow
DevicePolicy
DirectoryMode
DirectoryNotEmpty
Documentation
DynamicUser
Environment
EnvironmentFile
ExecReload
ExecStart
ExecStartPost
ExecStartPre
ExecStop
ExecStopPost
ExecStopPre
FailureAction
FileDescriptorName
FileDescriptorStoreMax
ForceUnmount
FreeBind
Group
GuessMainPID
IOAccounting
IODeviceWeight
IOReadBandwidthMax
IOReadIOPSMax
IOSchedulingClass
IOSchedulingPriority
IOWeight
IOWriteBandwidthMax
IOWriteIOPSMax
IPTOS
IPTTL
IgnoreOnIsolate
IgnoreSIGPIPE
InaccessiblePaths
JobRunningTimeoutSec
JobTimeoutAction
JobTimeoutRebootArgument
JobTimeoutSec
JoinsNamespaceOf
KeepAlive
KeepAliveIntervalSec
KeepAliveProbes
KeepAliveTimeSec
KillMode
KillSignal
LazyUnmount
LimitAS
LimitCORE
LimitCPU
LimitDATA
LimitFSIZE
LimitLOCKS
LimitMEMLOCK
LimitMSGQUEUE
LimitNICE
LimitNOFILE
LimitNPROC
LimitRSS
LimitRTPRIO
LimitRTTIME
LimitSIGPENDING
LimitSTACK
ListenDatagram
ListenFIFO
ListenMessageQueue
ListenNetlink
ListenSequentialPacket
ListenSpecial
ListenStream
ListenUSBFunction
MakeDirectory
Mark
MaxConnections
MaxConnectionsPerSource
MemoryAccounting
MemoryDenyWriteExecute
MemoryHigh
MemoryLimit
MemoryLow
MemoryMax
MemorySwapMax
MessageQueueMaxMessages
MessageQueueMessageSize
MountAPIVFS
MountFlags
Nice
NoDelay
NoNewPrivileges
NonBlocking
NotifyAccess
OOMScoreAdjust
OnActiveSec
OnBootSec
OnCalendar
OnFailure
OnFailureJobMode
OnStartupSec
OnUnitActiveSec
OnUnitInactiveSec
Options
PAMName
PIDFile
PartOf
PassCredentials
PassEnvironment
PassSecurity
PathChanged
PathExists
PathExistsGlob
PathModified
PermissionsStartOnly
Persistent
Personality
PipeSize
Priority
PrivateDevices
PrivateNetwork
PrivateTmp
PrivateUsers
PropagatesReloadTo
ProtectControlGroups
ProtectHome
ProtectKernelModules
ProtectKernelTunables
ProtectSystem
RandomizedDelaySec
ReadOnlyPaths
ReadWritePaths
RebootArgument
ReceiveBuffer
RefuseManualStart
RefuseManualStop
ReloadPropagatedFrom
RemainAfterElapse
RemainAfterExit
RemoveIPC
RemoveOnStop
RequiredBy
Requires
RequiresMountsFor
Requisite
Restart
RestartForceExitStatus
RestartPreventExitStatus
RestartSec
RestrictAddressFamilies
RestrictNamespaces
RestrictRealtime
ReusePort
RootDirectory
RootDirectoryStartOnly
RootImage
RuntimeDirectory
RuntimeDirectoryMode
RuntimeMaxSec
SELinuxContext
SELinuxContextFromNet
SecureBits
SendBuffer
SendSIGHUP
SendSIGKILL
Service
Slice
SloppyOptions
SmackLabel
SmackLabelIPIn
SmackLabelIPOut
SmackProcessLabel
SocketGroup
SocketMode
SocketProtocol
SocketUser
Sockets
SourcePath
StandardError
StandardInput
StandardOutput
StartLimitAction
StartLimitBurst
StartLimitIntervalSec
StartupBlockIOWeight
StartupCPUShares
StartupCPUWeight
StartupIOWeight
StopWhenUnneeded
SuccessExitStatus
SupplementaryGroups
Symlinks
SyslogFacility
SyslogIdentifier
SyslogLevel
SyslogLevelPrefix
SystemCallArchitectures
SystemCallErrorNumber
SystemCallFilter
TCPCongestion
TTYPath
TTYReset
TTYVHangup
TTYVTDisallocate
TasksAccounting
TasksMax
TimeoutIdleSec
TimeoutSec
TimeoutStartSec
TimeoutStopSec
TimerSlackNSec
Transparent
TriggerLimitBurst
TriggerLimitIntervalSec
Type
UMask
USBFunctionDescriptors
USBFunctionStrings
Unit
User
UtmpIdentifier
UtmpMode
WakeSystem
WantedBy
Wants
WatchdogSec
What
Where
WorkingDirectory
Writable
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment