You are not logged in.
After a fresh installation i get this error when i try to edit any unit files.
Cannot edit units if not on a tty.I startx and autologin exactly the way described in wiki and a who command confirms i am logged on tty1.How can i debug this?There seems to be no answers in google.Anyone has any idea?
Offline
If you are under X, you are not on a tty, you are on a pty pseudo terminal.
But what command are you using to get that ouput? You can just open a unit file in any text editor which will fork fine under any terminal.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Online
Thanks for your reply and sorry for the delayed response.
I just input commands like systemctl edit sshd.socket or systemctl edit fstrim.timer i tried switching to a tty but the response is the same..
I do manual overrides for now but i am worried i messed up something in my installation
Offline
Those commands should work from within X. Do you log in as root, or are you using sudo?
What is the output of `loginctl`?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Online
input commands like systemctl edit sshd.socket
What is the *exact* command?
on_tty() checks for isatty of stdin & stderr, so if you redirect/pipe the output of the command, you'll get this error (which, granted, is of lennart-grade uselessnes…)
Online
Thanks for you time guys.I know i am not very helpful but i am kinda in the dark in how systemd works ![]()
loginctl output:
$ loginctl
SESSION UID USER SEAT TTY
1 1000 dimitris seat0 tty1
1 sessions listed.service edit output:
$ systemctl edit sshd.socket
Cannot edit units if not on a tty.
$ systemctl status sshd.socket
● sshd.socket
Loaded: loaded (/usr/lib/systemd/system/sshd.socket; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/sshd.socket.d
└─override.conf
Active: active (listening) since Thu 2018-09-27 13:20:50 EEST; 3min 1s ago
Listen: [::]:xxxx (Stream)
Accepted: 0; Connected: 0;
Tasks: 0 (limit: 4915)
Memory: 0B
CGroup: /system.slice/sshd.socket
Sep 27 13:20:50 archos systemd[1]: Listening on sshd.socket.start X which seems to be irrelevant since i cant edit even on tty2+
% cat xserverrc
#!/bin/sh
exec /usr/bin/Xorg -keeptty -nolisten tcp "$@" vt$XDG_VTNR > /dev/null
$ cat ~/.config/zsh/.zlogin
if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
exec startx &> /dev/null
figetty tty1 override
[Service]
Type=simple
ExecStart=
ExecStart=-/usr/bin/agetty --autologin dimitris --nohints --nohostname --noissue %I $TERMLast edited by DimitrisLol (2018-09-27 10:30:50)
Offline
Wild guess: output of "echo $EDITOR"?
Also this looks like you're attempting to edit the service as regular user?
Online
Sorry for the delay.Nope its not that
$echo $EDITOR
vimeditor is set and the error message appears even when trying to edit as root.Guess i should take this upstream?
Offline
Maybe - what kind of shell and VTE is that?
(Though I understand it even happens on the linux console?)
Online
I had the "Cannot edit units if not on a tty." which led me here. Problem was I have a function that wraps systemctl with generic colouriser grc package.
which systemctl
systemctl () {
grc --colour=auto ${commands[$0]} "$@"
}using the full path
/usr/bin/systemctl edit unitfileworks fine.
Offline