Re: trying to run tightvnc as a systemd service on Debian/Bookworm
Tony Su <[email protected]> Sun, 11 Sep 2022 20:24:45 -0700
| Newsgroups | gmane.network.tight-vnc.general |
|---|---|
| Message-ID | <CACNuKqQNMF6C-KdRf2sqbprDVb+-kY-6ex7cUKs31fw+G30+sg@mail.gmail.com> |
Since no one has answered, although I am more familiar with TigerVNC running on openSUSE, I'll answer as best I can acknowledging there are differences but enough that's the same to put you on the right path. I'll try to avoid any landmines that I know exist when recommending something that is not likely the same on your setup. First, You're working on a pre-release version of Debian. Know that if you want to be that far ahead of the main Debian community (current is 2 versions earlier), there won't be much documentation specific to your version of Debian so you'll be on your own a lot. If you prefer more help and a less buggy version of Linux, you should be instead working on Debian 10 which is the current official release or Debian 11 which is the next release... Not on Debian 12 (bookworm) which is 'way out there ahead of everyone. But, if you're adventurous and want to learn, keep doing what you're doing... Usually when someone posts their problem and attempted solution, my first reaction is always to ask what guide or reference they're following. Even most experienced geeks know that no matter how skilled you are, if there is a ready solution is published somewhere that works, it's a slam dunk to copy and paste your way to success. Even if you're a genius, creating stuff from scratch is always going to be subject to simple or surprising mistakes. I usually recommend a User try to look up the documentation for their distro as a main reference so that what you configure will be similar to other Users in that community. VNC in particular is particularly susceptible to being setup in numerous ways, some very old and sometimes crazy that would make your system look very different than other systems people normally build. If you want to live a solitary life of not benefiting from community help, go ahead and build your very unique creation. But, if you think you might want to ask the Debian community for help on something in the future, you're better advised to follow whatever is in the Debian User Manual if the topic exists... Even if the documentation is for an older version of Debian. My last comment is that if you have a SysVinit command that works, you can always embed that command in a systemd service unit file, and it will work. systemd is designed that way, to be 100% (yes 100%) backwards compatible with SysVinit so all old scripts and commands should work just fine in systemd unless that function is for some reason removed which is fairly rare. Yes, add a few additional parameters to make sure that the service you're creating starts only when dependencies have been loaded and possibly are running and if there is anything you want to execute after your VNC service starts, insert those parameters, too. But note that this is a method of last resort. Oh, and I guess one more "last-last" comment... If this is your first time creating a systemd service, do you know how to do this properly? Although I wouldn't know the specifics without investigation because I use a different distro, I do know that on any distro there is one place where the default systemd units are located and there is another location where the User can add and modify systemd units. This is so that the User can confine his actions to a specific file location and not endanger the system by making some disastrous mistake that would be difficult to recover. Done properly, if a User creation could cause potential damage, if systemd recognizes the danger then the User creation is not activated. If the User wants to undo a creation, it only requires deleting the User unit file. No default unit files should be touched which means that no files should be accidentally deleted. The User is protected from making mistakes. But, only if the User creates new systemd Unit files the correct way. HTH, Tony On Sun, Sep 11, 2022 at 8:26 AM Gary Dale <[email protected]> wrote: > > While I agree that systemd isn't perfect, there doesn't seem to be a lot of point in fighting it. While System V Init worked, it had some significant problems too. The current hybrid startup (using systemd to run init scripts) isn't going to be around forever. > > I'm not at the point of trying to use XFCE instead of KDE. I'd just like to be able to get it running first. I'm using sddm, not gdm. > > I'm pretty sure the tightvncserver allocates the next available port automatically unless you specify something else. In my case, that would be port 5901. Indeed, I can run the vncserver command multiple times and it ups the port number by 1 for each new instance. > > > > On 2022-09-10 23:45, Michael D. Setzer II wrote: > > Don't know the stuff they are trying to do with systemd?? > Took something that worked fine, and trying to replace it with something that has issues. > I start my vncserver with rc.local in /etc/rc.d/rc.local > runuser -l msetzerii -c 'vncserver :79 -geometry 1600x845' > And it creates this process that works perfectly. > msetzer+ 1389 1 0 09:37 ? 00:00:07 /usr/bin/Xvnc :79 -auth /home/msetzerii/.Xauthority -desktop setzco.dyndns.org:79 (msetzerii) -fp catalogue:/etc/X11/fontpath.d -geometry 1600x845 -pn -rfbauth /home/msetzerii/.vnc/passwd -rfbport 5979 > ~/.vnc/xstartup has > #!/bin/sh > # Uncomment the following two lines for normal desktop: > unset SESSION_MANAGER > unset DBUS_SESSION_BUS_ADDRESS > exec /bin/sh /etc/xdg/xfce4/xinitrc # X11/xinit/xinitrc > [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup > [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources > xsetroot -solid grey > #vncconfig -iconic & > xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & > startxfce4 & > #twm & > Didn't see your info specifying a port to use for the vnc? > I tried to do the systemd stuff, but never was able to get it to work. Have 5 machines in home that have vnc running on various ports on each, and have no isses with anything between them. Do use xfce instead of gnome options, since it didn't work with a local login and a vnc long at same time. tried various options for the gnome, but no luck. Old method has worked since Redhat 9 for me, and current machines running fc35 and one with fc36.. > Well, Good Luck, Maybe someone else has had better luck, or knows the secrets. > On 10 Sep 2022 at 21:53, Gary Dale wrote: > Date sent: Sat, 10 Sep 2022 21:53:19 -0400 > To: [email protected] > From: Gary Dale <[email protected]> > Subject: trying to run tightvnc as a systemd service on Debian/Bookworm > > Here's my vncserver.service file: > > > > [Unit] > > Description=Start TightVNC server at startup > > After=syslog.target network.target > > > > [Service] > > Type=forking > > User=garydale > > Group=garydale > > WorkingDirectory=/home/garydale > > > > PIDFile=/home/garydale/.vnc/%H:%i.pid > > ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1 > > ExecStart=/usr/bin/vncserver -depth 24 -geometry 1024x768 :%i > > ExecStop=/usr/bin/vncserver -kill :%i > > > > [Install] > > WantedBy=multi-user.target > > > > > > When I try to start the service I get this: > > > > # systemctl start vncserver > > Job for vncserver.service failed because the control process exited with > > error code. > > See "systemctl status vncserver.service" and "journalctl -xeu > > vncserver.service" for details. > > > > # systemctl status vncserver.service > > × vncserver.service - Start TightVNC server at startup > > Loaded: loaded (/etc/systemd/system/vncserver.service; enabled; > > preset: enabled) > > Active: failed (Result: exit-code) since Sat 2022-09-10 21:44:28 > > EDT; 29s ago > > Process: 9180 ExecStartPre=/usr/bin/vncserver -kill : > /dev/null > > 2>&1 (code=exited, status=255/EXCEPTION) > > Process: 9184 ExecStart=/usr/bin/vncserver -depth 24 -geometry > > 1024x768 : (code=exited, status=255/EXCEPTION) > > CPU: 37ms > > > > Sep 10 21:44:28 transponder vncserver[9184]: -httpport number > > Sep 10 21:44:28 transponder vncserver[9184]: -basehttpport number > > Sep 10 21:44:28 transponder vncserver[9184]: -alwaysshared > > Sep 10 21:44:28 transponder vncserver[9184]: -nevershared > > Sep 10 21:44:28 transponder vncserver[9184]: -pixelformat rgb<NNN> > > Sep 10 21:44:28 transponder vncserver[9184]: -pixelformat bgr<NNN> > > Sep 10 21:44:28 transponder vncserver[9184]: See vncserver and Xtightvnc > > manual pages for more information. > > Sep 10 21:44:28 transponder systemd[1]: vncserver.service: Control > > process exited, code=exited, status=255/EXCEPTION > > Sep 10 21:44:28 transponder systemd[1]: vncserver.service: Failed with > > result 'exit-code'. > > Sep 10 21:44:28 transponder systemd[1]: Failed to start Start TightVNC > > server at startup. > > > > # journalctl -xeu vncserver.service > > Sep 10 21:44:28 transponder vncserver[9184]: -httpport number > > Sep 10 21:44:28 transponder vncserver[9184]: -basehttpport number > > Sep 10 21:44:28 transponder vncserver[9184]: -alwaysshared > > Sep 10 21:44:28 transponder vncserver[9184]: -nevershared > > Sep 10 21:44:28 transponder vncserver[9184]: -pixelformat rgb<NNN> > > Sep 10 21:44:28 transponder vncserver[9184]: -pixelformat bgr<NNN> > > Sep 10 21:44:28 transponder vncserver[9184]: See vncserver and Xtightvnc > > manual pages for more information. > > Sep 10 21:44:28 transponder systemd[1]: vncserver.service: Control > > process exited, code=exited, status=255/EXCEPTION > > ░░ Subject: Unit process exited > > ░░ Defined-By: systemd > > ░░ Support: https://www.debian.org/support > > ░░ > > ░░ An ExecStart= process belonging to unit vncserver.service has exited. > > ░░ > > ░░ The process' exit code is 'exited' and its exit status is 255. > > Sep 10 21:44:28 transponder systemd[1]: vncserver.service: Failed with > > result 'exit-code'. > > ░░ Subject: Unit failed > > ░░ Defined-By: systemd > > ░░ Support: https://www.debian.org/support > > ░░ > > ░░ The unit vncserver.service has entered the 'failed' state with result > > 'exit-code'. > > Sep 10 21:44:28 transponder systemd[1]: Failed to start Start TightVNC > > server at startup. > > ░░ Subject: A start job for unit vncserver.service has failed > > ░░ Defined-By: systemd > > ░░ Support: https://www.debian.org/support > > ░░ > > ░░ A start job for unit vncserver.service has finished with a failure. > > ░░ > > ░░ The job identifier is 11431 and the job result is failed. > > lines 64-92/92 (END) > > > > > > However: > > $ vncserver > > Couldn't start Xtightvnc; trying default font path. > > Please set correct fontPath in the vncserver script. > > > > New 'X' desktop is transponder:1 > > > > Starting applications specified in /home/garydale/.vnc/xstartup > > Log file is /home/garydale/.vnc/transponder:1.log > > > > garydale@transponder:~$ ps aux | grep vnc > > garydale 9959 0.0 0.0 9932 7276 pts/3 S 21:49 0:00 > > Xtightvnc :1 -desktop X -auth /home/garydale/.Xauthority -geometry > > 1024x768 -depth 24 -rfbwait 120000 -rfbauth /home/garydale/.vnc/passwd > > -rfbport 5901 -co /etc/X11/rgb > > garydale 9981 0.0 0.0 11412 2168 pts/3 S+ 21:50 0:00 grep vnc > > > > > > I'm trying to figure out what I'm doing wrong that is preventing it from > > starting as a systemd service. Any ideas? > > > > Thanks. > > > > > > > > ___________________________________________________________ > > TightVNC mailing list, [email protected] > > To change your subscription or to UNSUBSCRIBE, please visit > > https://lists.sourceforge.net/lists/listinfo/vnc-tight-list > +------------------------------------------------------------+ > Michael D. Setzer II - Computer Science Instructor (Retired) > mailto:[email protected] > mailto:[email protected] > Guam - Where America's Day Begins > G4L Disk Imaging Project maintainer > http://sourceforge.net/projects/g4l/ > +------------------------------------------------------------+ > > ___________________________________________________________ > TightVNC mailing list, [email protected] > To change your subscription or to UNSUBSCRIBE, please visit > https://lists.sourceforge.net/lists/listinfo/vnc-tight-list ___________________________________________________________ TightVNC mailing list, [email protected] To change your subscription or to UNSUBSCRIBE, please visit https://lists.sourceforge.net/lists/listinfo/vnc-tight-list