Author |
Post |
|
#1 Mon Sep 28, 2009 10:02, 177 months ago.
|
Member
Registered: Sep 2009
Location: Finland
|
Hello,
I'm using Ubuntu 9.04 and installed SMSTools directly via apt-get, the version I'm using is 3.1.3.
Everything is working well, and the SMS is working in both directions, but I noted one thing in the logs that curious about.
When smsd is started during bootup, it is started with smsd:smsd, but then if I stop/start it (with root user) then it will be started with the smsd:dialout, so it will change group.
2009-09-28 12:14:46,2, smsd: Smsd v3.1.3 started. 2009-09-28 12:14:46,2, smsd: Running as smsd:smsd. 2009-09-28 12:42:11,2, smsd: Smsd main program is awaiting the termination of all modem handlers. 2009-09-28 12:42:11,2, GSM1: Modem handler 0 terminated. 2009-09-28 12:42:11,2, smsd: Smsd main program terminated. 2009-09-28 12:42:16,2, smsd: Smsd v3.1.3 started. 2009-09-28 12:42:16,2, smsd: Running as smsd:dialout.
At the moment I have not noted any difference in the functionality, but I'm wondering why it is changing.
I tried to add the user/group to smsd.conf with the user = smsd and group = smsd, but it did not have any affect.
Here is ps -ef after bootup;
smsd 2320 1 0 12:59 ? 00:00:00 /usr/sbin/smsd -p/var/run/smstools/smsd.pid -i/var/run/smstools/smsd.working -usmsd -gsmsd smsd 2321 2320 0 12:59 ? 00:00:00 /usr/sbin/smsd -p/var/run/smstools/smsd.pid -i/var/run/smstools/smsd.working -usmsd -gsmsd
and here is ps -ef after stop/start of the smsd
smsd 3104 1 0 12:57 ? 00:00:00 /usr/sbin/smsd -p/var/run/smstools/smsd.pid -i/var/run/smstools/smsd.working -usmsd -gdialout smsd 3105 3104 0 12:57 ? 00:00:00 /usr/sbin/smsd -p/var/run/smstools/smsd.pid -i/var/run/smstools/smsd.working -usmsd -gdialout
anyone have any ideas about this behavior?
Regards, Sebastian
|
|
#2 Mon Sep 28, 2009 17:29, 177 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Thanks for the information. Ubuntu package smstools_3.1.3-2_i386.deb uses dpkg-statoverride to override the permissions. dpkg-statoverride --list /var/run/smstools says: smsd smsd 2755 /var/run/smstools. I think it should be: smsd dialout 2755 /var/run/smstools. In the script /etc/init.d/smstools there is a line: dpkg-statoverride --update --add smsd smsd 2755 $rundir
This could be changed to: dpkg-statoverride --update --add $USER $GROUP 2755 $rundir It however has no effect as long as a wrong entry exists in the database. It should be first removed with a command dpkg-statoverride --remove /var/run/smstools. Quote At the moment I have not noted any difference in the functionality, but I'm wondering why it is changing.
In my test, with a fresh install of Ubuntu 9.04, the smsd was unable to run after bootup (with incorrect group setting). There was a permission denied for the serial port. The port was owned by root:dialout, as usual. Quote I tried to add the user/group to smsd.conf with the user = smsd and group = smsd, but it did not have any affect.
User/group settings in the smsd.conf does not have an effect when command line arguments are used. Settings are only for very special cases, when there is no init script used. Generally taken, init script sms3 or smstools should always be used.
|
|
#3 Wed Sep 30, 2009 11:43, 177 months ago.
|
Member
Registered: Sep 2009
Location: Finland
Topic owner
|
Hi, I did some checking. It seems that the 'smsd' is included in the 'dialout' group, so this should not be an issue, the user/group should be fine with smsd/smsd. My devices have 'dialout' as group, And SMSTools seems to have added smsd to the 'dialout' group during installation, So this suggest that when running with smsd:smsd is correct behaviour, and even if the smsd:dialout works fine. There is a problem with your suggestion, or correct me if I'm wrong. The '$USER' and '$GROUP' variables are not set before the "dpkg-statoverride --update --add smsd smsd 2755 $rundir" line, as you suggested to replace the existing 'smsd smsd', so this would not work. I tested it, and it did not change anything, I guess if the user/group is not defined when starting it will automatically start it with smsd/smsd. I have not changed the ownerships of the devices, only thing I have done is to implement UDEV rules to the Huawei E196 UMTS modem, But this does not change the ownerships, to my knowledge, only access mode. Best regards, Sebastian
|
|
#4 Wed Sep 30, 2009 12:41, 177 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Your setup works with smsd:smsd because you have changed the mode of ports to crw-rw-rw- (666, "world-writable") with UDEV. By default the mode is 660 and the port is not accessible, even when the user smsd belongs to dialout group. I have to check this out later, probably there is something missing in the daemon... Variables $USER and $GROUP are set in the file /etc/default/smstools which is read before the permissions are checked. I think that your # dpkg-statoverride --list /var/run/smstools still says: smsd smsd 2755 /var/run/smstools, and therefore new permissions are not set. You have to remove this entry first.
|
|
#5 Thu Oct 01, 2009 06:17, 177 months ago.
|
Member
Registered: Sep 2009
Location: Finland
Topic owner
|
Ok, So in that case the udev definition will be a good work around for current situations then.
Yes, you are correct, after the installation the smsd:smsd was the default user:group.
Regards, Sebastian
|