You are not logged in.
Project page: http://xyne.archlinux.ca/projects/serman/
Serman (service manager) is a simple ncurses-based systemd service manager. It provides an easy way to manage services with an overview of what is currently enabled, running, etc.
The package now includes a second executable named serman2. All of the service management functionality works but there are still a few gui bugs (mostly when reszing the window in text view). I'll sort that out soon. In the meantime, please test it and post feedback.
(There are more on the project page.)
I wrote a simple script for basic dialog-based systemd service file management (enable/disable, start/stop). There's probably some much more robust, built-in way to do this with systemd but I didn't find it. Besides, I had just finished setting up systemd and writing netcfg-checklist, so curiosity got the best of me.
If this is useful it will likely be expanded and packaged. You can get serman here for now. See
serman -h
for options.
Caveats: I'm a systemd noob and this has not been extensively tested. That said, the script is simple and it should be safe unless you run it as root and play Russian roulette with the core services.
Feedback welcome.
Last edited by Xyne (2013-03-01 08:32:20)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Just tried it, and it didn't work
Traceback (most recent call last):
File "./serman", line 161, in <module>
main()
File "./serman", line 86, in main
newly_enabled = checked - enabled
UnboundLocalError: local variable 'enabled' referenced before assignment
Offline
fixed
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Works well now, seems pretty useful. Thanks.
Offline
Added some new options:
usage: serman [-h] [-e] [-o <unit command>] [-r] [-s] [--height HEIGHT]
[--width WIDTH] [--list-height LIST_HEIGHT]
Generate dialogues for systemd service management.
optional arguments:
-h, --help show this help message and exit
-e, --enable Enable and disable services.
-o <unit command>, --other <unit command>
Run a unit command on each selected service.
-r, --restart Start or restart services.
-s, --start Start and stop services.
Geometry:
--height HEIGHT Dialogue height. Default: Adjusted to fit list height.
--width WIDTH Dialogue width. Default: 60.
--list-height LIST_HEIGHT
Dialogue list-height. Default: 13.
I'll likely package it soon.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
*bump*
packaged
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
This is good stuff, like rcconf for sysvinit. You might see about getting it included upstream, I know Lennart was talking about being open to a python/C curses frontend next to systemadm.
Offline
This is probably too simplistic for upstream inclusion. A python curses rewrite is on my todo list. Maybe then it will be worth contacting upstream.
Thanks for the feedback.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Looks nice and pre-empted my simple bash wrapper that one day I'd get round to writing.
Is there any chance of allowing the ability to pass "--user" through to work on user units?
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
any chance of allowing the ability to pass "--user" through to work on user units?
I was wondering this same thing. If it can work on both --system and --user, that would be really quite cool.
All the best,
-HG
P.S., Curses is awesome, do all the things in curses!
Offline
Rather than gradually duplicate multiple systemctl options, I have added a single option to pass remaining arguments to systemctl. I don't use systemd login sessions so I can't test it, but you should now be able to manage user services with "-a --user" at the end of the command. If it doesn't work, use the new "--dry-run" option, inspect the command, determine what is wrong with it, and let me know how to fix it.
New options:
-a, --args: additional arguments to systemctl
--systemctl: systemctl binary
--dry-run: print systemctl commands instead of running them (still runs some commands to list services)
The extra arguments are directly passed to systemctl without any parsing, so make sure that you know what you are doing when you use that option.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Just tried it with --user and it worked great, thanks. Didn't try all operations with it, just status and restart (I'll probably use those two 80% of the time), and they worked well.
Many thanks.
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
A python curses rewrite is on my todo list.
Well, that's mostly done now. I was just going to glance over the Python curses documentation but got sucked into programmer's limbo and ended up rewriting serman in a single session. The code needs some cleaning (one session + completely new to ncurses = suboptimal design but too too shabby for a first attempt) and there are still a few gui bugs* (but none in service management, at least not that I've found so far).
I have included the new version as "serman2" in the package. Please give it a try. You can see a screenshot in the OP (there's another one on the site).
Quickstart guide:
serman2 --help shows the current options (minor changes)
Run serman2 and press F1 to get to the help message.
Check the comments at the top of the file for more information. I'll fix any bugs in service management as soon as I become aware of them (not expecting any though, because it's the same code as the original serman). I don't want to deal with curses resizing errors any time soon, Maybe it's just because I'm ridiculously tired, but the geometry management remains a black art to me at this point.*
Enjoy!
* If you shrink the help message window horizontally, it doesn't update, but shrinking it vertically or expanding in any direction works as expected. I think the problem is that each time it is shrunk, a character is written outside of the allocated horizontal space, but I just can't for the life of me figure out what I need to adjust. Again, I'm ridiculously tired so probably missing something simple, but it just makes no sense to me and the fscking "ERR" error messages don't help.
Sleepy time.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I just installed this from the AUR and there is no serman2... am I missing something or is this an oversight due to sleep deprivation?
Offline
or is this an oversight due to sleep deprivation?
yeah, that
I forgot to sync my AUR packages after mirroring to the server. It's up now (just downloaded it and checked)
also, not using my repo
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Then have a nice and healthy sleep!!
To quit serman2, which works with Ctrl+c, I expected something like 'q'. Would be more consistent with other cli apps imo. And maybe include vim-like navigation (hjkl, gg, G)? Don't know if I'll ever need this, but it sure looks nice
Offline
also, not using my repo
I know you have a repo, but your stuff tends to be just scripts, so because I only take a few things here and there from your contributions, I figure using the AUR for your stuff with the zero compile time it takes is not such a hassle...
Edit: Okay, its working, and its real purdy... though I have noticed two things I figured I should report back to you. One is that it doesn't seem to handle the @ services. Like netctl-auto@.service is indeed active as netctl-auto@wlan0.service. Also it would be nice with some vi keybindings
Last edited by WonderWoofy (2013-03-17 19:50:01)
Offline
@Army & @WonderWoofy
I bound q at first, but then I made it possible to jump to characters in lists by typing them. Maybe I'll rework it later to use meta keys (maybe alt?). The same considerations apply for vim key bindings. I plan to make it configurable in any case but I want to give it some thought first. The easiest way will be to dump all the colors, symbols, status messages and binds in a JSON file and let the user configure that however he wants.
I'm looking at a minor bug in service detection right now. I noticed that it effectively filters some of them.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I have installed serman from the AUR, but upon using serman2 , I have noticed that the status triangles & icons are not shown.
a friend has also installed it & reported the same problem.
Screenshot - image link
modedit (Xyne)
replace huge image with link to avoid accusations of letting things slide in my threads
Offline
I don't think xterm supports Unicode characters. On my system, it displays empty boxes where the symbols should be, I don't know why you see nothing at all instead of boxes.
Try using rxvt-unicode instead of xterm. If you still don't see the symbols then it's likely due to missing fonts. Can you see the symbols below in your webbrowser?
circle: ●
triangle: ▲
I think they're provided by ttf-freefont so you can try installing that. If that fixes it, then I will add it as a dependency.
Otherwise, post the output of
post the output of
pacman -Qqs font
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thanks for the quick reply.
As for the symbols in the browser, yes I can see them, but I have installed (urxvt & ttf-freefont) & I still can't see the symbols in serman.
here is the output :
[ArchLinux] >> pacman -Qqs font
bdf-unifont
cantarell-fonts
font-misc-ethiopic
fontconfig
fontsproto
freetype2
gsfonts
lib32-freetype2
libfontenc
libxfont
libxft
pangox-compat
ttf-arabeyes-fonts
ttf-bitstream-vera
ttf-dejavu
ttf-freefont
ttf-ms-fonts
xorg-bdftopcf
xorg-font-util
xorg-font-utils
xorg-fonts-100dpi
xorg-fonts-75dpi
xorg-fonts-alias
xorg-fonts-encodings
xorg-fonts-misc
xorg-mkfontdir
xorg-mkfontscale
Last edited by PrivateLooms (2013-05-02 04:48:02)
Offline
Thanks for your help anyway.
it got fixed when I entered the following command
export LANG=en_US.UTF-8
Last edited by PrivateLooms (2013-05-02 07:05:12)
Offline
I don't think xterm supports Unicode characters.
On my system it does, both running as 'xterm' and as 'uxterm'.
Nice work, as always :-)
Offline
This is great - I'm loving serman2. Is there a way to go back to the "default" view though from the F1/F2 displays? Right now I can't find anyway to do so but to Ctrl-C then restart serman2. Also, I'm currently getting a blank screen with F2 on any service, but this may be due to permissions issues with systemd-journal which I've never gotten around to setting up properly.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Is there a way to go back to the "default" view though from the F1/F2 displays? Right now I can't find anyway to do so but to Ctrl-C then restart serman2.
Press enter.
In the 'Text Views (F1, F2)' section the last bullet point says "enter returns to the main view".
It kinda forces you to read the whole thing once you press F1 when just trying things out ;P
Also, I'm currently getting a blank screen with F2 on any service, but this may be due to permissions issues with systemd-journal which I've never gotten around to setting up properly.
Same here.
Last edited by karol (2013-05-11 00:43:46)
Offline