Forum

ServerId strangeness

Gour
28 November 2014, 22:03
Hello,

in last few days I was busy migrating my desktop/notebook machines from Debian (Sid) to openSUSE-13.2 and today noticed some strange behaviour with Hiawatha...

Default uid:gid on Suse are wwwrun:www, but when I put

ServerId = wwwrun:www


in my conf file, Hiawatha complains:

hiawatha.service - Hiawatha Web Server
Loaded: loaded (/usr/lib/systemd/system/hiawatha.service; enabled)
Active: failed (Result: exit-code) since Fri 2014-11-28 21:58:17 CET; 7s ago
Process: 16313 ExecStart=/usr/sbin/hiawatha -d (code=exited, status=0/SUCCESS)
Process: 23639 ExecStartPre=/usr/sbin/hiawatha -k (code=exited, status=1/FAILURE)
Process: 23636 ExecStartPre=/usr/sbin/wigwam (code=exited, status=0/SUCCESS)
Main PID: 16313 (code=exited, status=0/SUCCESS)

Nov 28 21:58:17 atmarama hiawatha[23636]: Using /etc/hiawatha
Nov 28 21:58:17 atmarama hiawatha[23636]: Reading hiawatha.conf
Nov 28 21:58:17 atmarama hiawatha[23636]: No non-fatal errors found in the Hiawatha configuration.
Nov 28 21:58:17 atmarama hiawatha[23639]: Syntax error in hiawatha.conf on line 7.
Nov 28 21:58:17 atmarama hiawatha[23639]: Using /etc/hiawatha
Nov 28 21:58:17 atmarama hiawatha[23639]: Reading hiawatha.conf


However, strange thing is that when I replace gid of 'www' with it numerical id ('8') like:

ServerId = wwwrun:8


everything is fine:

hiawatha.service - Hiawatha Web Server
Loaded: loaded (/usr/lib/systemd/system/hiawatha.service; enabled)
Active: active (running) since Fri 2014-11-28 21:58:47 CET; 2s ago
Process: 23715 ExecStartPre=/usr/sbin/hiawatha -k (code=exited, status=0/SUCCESS)
Process: 23714 ExecStartPre=/usr/sbin/wigwam (code=exited, status=0/SUCCESS)
Main PID: 23719 (hiawatha)
CGroup: /system.slice/hiawatha.service
└─23719 /usr/sbin/hiawatha -d

Nov 28 21:58:47 atmarama hiawatha[23714]: Using /etc/hiawatha
Nov 28 21:58:47 atmarama hiawatha[23714]: Reading hiawatha.conf
Nov 28 21:58:47 atmarama hiawatha[23714]: No non-fatal errors found in the Hiawatha configuration.
Nov 28 21:58:47 atmarama hiawatha[23715]: Using /etc/hiawatha
Nov 28 21:58:47 atmarama hiawatha[23715]: Reading hiawatha.conf
Nov 28 21:58:47 atmarama hiawatha[23715]: Reading mimetype.conf
Nov 28 21:58:47 atmarama hiawatha[23715]: Configuration OK.


It's a bit strange so I wonder why would 'www' gid cause problem?


Sincerely,
Gour

Hiawatha version: Hiawatha 9.7
Operating System:
Hugo Leisink
28 November 2014, 22:08
Please confirm that the group 'www' exists on your system? In other words, that it is present in /etc/group.
Gour
28 November 2014, 22:42
It does:

...
www:x:8:gour
Hugo Leisink
28 November 2014, 22:46
Ok, change the following in src/userconfig.c:
line 49: passwd -> group
line 57: getpwnam -> getgrnam
line 60: pw_gid -> gr_gid

Looks like you've triggered a bug in a feature no one has ever used. Please let me know if this solves your issue.
Gour
29 November 2014, 14:17
> Looks like you've triggered a bug in a feature no one has ever used.

It's a bit strange considering that that uid:gid pair should be common one on openSUSE.

> Please let me know if this solves your issue.

Yes it does, but it took me some time to become somewhat familiar with openSUSE's build service. I did commit patch to their service and built new RPM as well.


Sincerely,
Gour
This topic has been closed.