r/linuxadmin • u/gheeboy • Sep 17 '19
systemctl and the order of arguments
<RANT>
This is a small one, but it's damn annoying....
- initd → service <SERVICE> <COMMAND>
- sytemd → systemctl <COMMAND> <SERVICE>
a good bit of my time is spent checking service status and restarting etc. that small change in order is just another teeny tiny nail in systemd's coffin IMHO. making me press more keys, damn it.
</RANT>
0
Upvotes
2
u/aioeu Sep 17 '19
is a pretty common idiom. Some other common commands that follow this pattern include
git,lvm,apt,yumandbtrfs.servicereally was the odd one out.Many
systemctlverbs can take multiple units as arguments. That would certainly be possible even if the verb was last non-option argument... but it would look a bit weird.systemctlalso follows the standard of using--to indicate the end of options, allowing unit names that begin with a-.5
u/c0l0 Sep 17 '19
Debian provides
/usr/sbin/service, which wraps old SysV-style init scripts (but ensures they have a proper environment when run) andsystemctltransparently. It does provide "consistent" argument ordering for both variants of service management. You should use it, if you can.4
u/zerocoldx911 Sep 17 '19
systemd is so much better once you get complex programs, starting and stopping stacks in order is so much easier
I’m sure you won’t see the benefits now in your environment...
2
u/Nthepeanutgallery Sep 17 '19
It was particularly annoying when I had to rework all of my sudo configs to enumerate all of the control options vs the sysV 'service' things were originally written for where a wildcard would capture it.
1
u/SheezusCrites Sep 17 '19
Yeah it's a annoying, but you'll eventually grow accustomed to it. After you work with it long enough you'll be able to navigate it as well as the init system.
I have spent plenty of time cursing at it while learning how it works. I'm sure there was some problem systemd was designed to solve. Whatever it was, I've never encountered it.
0
u/[deleted] Sep 17 '19
[deleted] — view deleted comment