Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Starting Webmin under systemd

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Starting Webmin under systemd

#1 Post by Soapm »

I've come a long way and can now start webmin using the command "/etc/webmin/start"

However, I can't get it to start as a systemd service using this service file;

Code: Select all

# Webmin can't be started by systemd until the service section is updated.
# To activate the service, copy this file to /etc/systemd/system/  (on Fedora)
# Then run:
# # systemctl start webmin.service
# Check /var/log/messages output.
# To automatically start webmin at boot, run:
# # systemctl enable webmin.service

[Unit]
Description=Webmin Server
After=network.target

[Service]
# Enter the absolute path to the pyTivo executable.
ExecStart=/etc/webmin/start

# Enter a username that has read/write privs on the shared directories
# User=nobody

# Enter the absolute path to your pytivo installation
WorkingDirectory=/etc/webmin/

StandardOutput=syslog 

[Install]
WantedBy=multi-user.target
The service does not run and I get this error when I try ...

Code: Select all

root@lenny:/var/tmp# systemctl status webmin
? webmin.service - Webmin Server
   Loaded: loaded (/lib/systemd/system/webmin.service; enabled)
   Active: inactive (dead) since Thu 2016-05-05 21:07:57 MDT; 8min ago
  Process: 10742 ExecStart=/etc/webmin/start (code=exited, status=0/SUCCESS)
 Main PID: 10742 (code=exited, status=0/SUCCESS)

May 05 21:07:55 lenny start[10742]: Starting Webmin server in /usr/share/webmin
May 05 21:07:56 lenny perl[10742]: pam_unix(webmin:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= ...er=root
May 05 21:07:56 lenny perl[10742]: pam_winbind(webmin:auth): getting password (0x00000388)
May 05 21:07:56 lenny perl[10742]: pam_winbind(webmin:auth): pam_get_item returned a password
May 05 21:07:56 lenny perl[10742]: pam_winbind(webmin:auth): request wbcLogonUser failed: WBC_ERR_AUTH_ERROR, PAM er...ch user
May 05 21:07:57 lenny webmin[10742]: Webmin starting
May 05 21:07:57 lenny start[10742]: Pre-loaded WebminCore
Hint: Some lines were ellipsized, use -l to show in full.
Any idea what this error is telling me?

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: Starting Webmin under systemd

#2 Post by ralph.ronnquist »

It looks like it tells you that root is not an authenticated user for webmin Maybe change the Exec line in the unit file to be

Code: Select all

Exec=su USER /etc/webmin/start
where you replace USER with the login name of the authenticatable user.

User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Re: Starting Webmin under systemd

#3 Post by Soapm »

ralph.ronnquist wrote:It looks like it tells you that root is not an authenticated user for webmin Maybe change the Exec line in the unit file to be

Code: Select all

Exec=su USER /etc/webmin/start
where you replace USER with the login name of the authenticatable user.
Tried it but no go... Still get the same error that it, "lacks ExecStart setting"...

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: Starting Webmin under systemd

#4 Post by ralph.ronnquist »

Ah, that's probably my bad advice. I'm quite a novice with systemd and not (yet?) familiar with the exact incantations. The better advice would have been to suggest using the line

Code: Select all

ExecStart=su USER /etc/webmin/start
Sorry about that, and well, it might be the right thing here, or not. The idea is that, since the ExecStart command line gets executed by root, then root can su to be that other USER for executing the start script.

However, if that start script involves getting a password typed in by a user, then there may still be hurdles in this. I don't know if the running of the script has a terminal to ask for password and get it typed in on, although being a startup script it probably doesn't.

User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Re: Starting Webmin under systemd

#5 Post by Soapm »

I am all googled out for today. Thee key to the error seems to be;

Code: Select all

NTSTATUS: NT_STATUS_NO_SUCH_USER, Error message was: No such user
According to this command I don't have domain users set up which makes sense to me, the most I should have is a workgroup.

Code: Select all

root@lenny:/var/tmp# wbinfo -u
Error looking up domain users
So the error seems to be related to Samba but why would Webmin be checking winbind but only when I launch it with this service file?

I can do "/etc/webmin/start" and it starts just fine...

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: Starting Webmin under systemd

#6 Post by ralph.ronnquist »

Right. It appears the startup script tries to do some scripted login, which fails.

Just as a test, run manually with the extended command line

Code: Select all

# /etc/webmin/start && echo "THAT WORKED FINE"
only to verify that the script doesn't silently end with an error code. Because an error code would upset systemd. Or perhaps you have already verified that it's not the case that the same authentication problem occurs, but gets ingored.

In any case, your original ExecStart command is fine for running it as root. The main execution environment differences are in having terminal or not, in the environment settings, and which shell runs the script. By the looks of it, for the automated start the script runs fine up to wanting authentication. Presumably it's not the case that your manual start includes you typing a password.

User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Re: Starting Webmin under systemd

#7 Post by Soapm »

Not sure what this means???

Code: Select all

root@lenny:/# /etc/webmin/start && echo "THAT WORKED FINE"
Starting Webmin server in /usr/share/webmin
failed to open /usr/bin/perl/miniserv.error : Not a directory at /usr/share/webmin/miniserv.pl line 5964.
THAT WORKED FINE
But it looks like there is bad code in file /usr/share/webmin/miniserv.pl down around line 5964.

ps... /usr/bin/perl is a file not a directory... So there is no miniserv.error inside...

Code: Select all

root@lenny:/# ls /usr/bin/perl/
ls: cannot access /usr/bin/perl/: Not a directory
also, this is the code around line 5964 in /usr/share/webmin/miniserv.pl

Code: Select all

# Re-direct STDERR to error log file
sub redirect_stderr_to_log
{
if ($config{'errorlog'} ne '-') {
        open(STDERR, ">>$config{'errorlog'}") ||
                die "failed to open $config{'errorlog'} : $!";
        if ($config{'logperms'}) {
                chmod(oct($config{'logperms'}), $config{'errorlog'});
                }
        }
select(STDERR); $| = 1; select(STDOUT);
}

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: Starting Webmin under systemd

#8 Post by ralph.ronnquist »

Yes, interesting: something possibly failing and the script returns success.

That actual problem has good web presence, since 2005 even. The path is terribly wrong; you wouldn't want a log file as /usr/bin/perl/miniserv.error. Especially since /usr/bin/perl is an executable :-)

However, it looks like a different problem problem from the one the automatic start has. Or, hmm, maybe this is webmin trying to deposit the authentication error messages...

If you are somewhat confident about these things, you should edit /usr/share/webmin/miniserv.pl (copy away a backup first, which you can restore later) and replace the file name argument of the function (open? print?) with a constant, say "/tmp/MYERROR". Maybe it goes further. You can then look into /tmp/MYERROR to see what the program wanted to say.

Perhaps also show the original line here, so maybe a perl master can venture a conjecture.

User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Re: Starting Webmin under systemd

#9 Post by Soapm »

Thanks for all the help but I think I got it fixed, I went to directory "/etc/webmin" and typed, "uninstall.sh" and now all the errors are gone.

What I realized was that I did use Webmin early on with this Debian boxes life but really haven't used it lately. I've been doing all the admin using SSH so I don't think it will be that big of a loss. Perhaps, someday, the developers will make a Debian package that works out of the box and I can reinstall at that time.

Here are the links to the package, perhaps one of you can see if it works for you...

https://sourceforge.net/projects/webadm ... irror=iweb

http://www.webmin.com/docs.html

Post Reply