LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   troubleshooting pam_mount with logs (https://www.linuxquestions.org/questions/linux-newbie-8/troubleshooting-pam_mount-with-logs-817540/)

politik 07-01-2010 10:18 PM

troubleshooting pam_mount with logs
 
Hello all,

I am trying to use pam_mount to auto mount some shares on an XP box and I am trying to figure out which log pam_mount writes to.

I've checked /var/logs/

daemon.log
debug.log
messages.log
syslog

and searching for "pam_mount" yields no results.

searching for "pam_mount" in auth.log gives some results but nothing too verbose.....only things like "mount failed" with no additional info.

Is there some other log I'm missing that pam_mount would be writing to ? Didn't see any other logs in /var/logs that look like pam_mount logs.

I've seen other people posting about troubleshooting pam_mount and their logs seem to have way more info that what I found in auth.log.

There is a setting in the pam_mount config file to enable debugging and I have it enabled.

Any ideas ?

Thanks.

subho.d 07-02-2010 01:33 AM

configure samba and then mount that 4m win system...

politik 07-02-2010 03:00 AM

Thanks for the reply.

I'll restate my question in more of a general manner to narrow things down:

I'm trying to troubleshoot an application that doesn't appear to write anything to syslog. I've enabled the debug option in the config file for this application, which is supposed to enable verbose output to syslog. But I still don't see any information for this application in syslog.

The app does write some info to /var/log/auth.log but this info isn't as verbose as what's supposed to be in syslog and it isn't enough info to troubleshoot properly.

Are there any newbie "gotchas" any one can think of that may be preventing my app from writing to syslog ?

When I look at the logs I do "gksudo gedit" to make sure I'm looking at the logs as superuser, and I reload the logs every time gedit prompts me to.

Is there something else I'm missing ?

Thanks.

unSpawn 07-02-2010 03:22 AM

Quote:

Originally Posted by politik (Post 4021428)
I'm trying to troubleshoot an application that doesn't appear to write anything to syslog. I've enabled the debug option in the config file for this application, which is supposed to enable verbose output to syslog. But I still don't see any information for this application in syslog.

Can you be more specific and provide application details, posting version nfo and configuration details if deemed necessary?


Quote:

Originally Posted by politik (Post 4021228)
searching for "pam_mount" in auth.log gives some results but nothing too verbose.....only things like "mount failed" with no additional info. (..) There is a setting in the pam_mount config file to enable debugging and I have it enabled.

Could you post your /etc/pam.d PAM stack in which you use pam_mount? And your /etc/security/pam_mount.conf.xml and ~/.pam_mount.conf.xml? Not sure if it helps but the more nfo the better.

politik 07-02-2010 01:23 PM

Hello unSpawn, thanks for the reply.

I was trying to keep it high level and ruleout any newbie gotchas about why pam_mount doesn't seem to be writing anything to syslog. I was hoping that once I got pam_mount to write more verbose info to the logs, there would be more info for me to go on, and then I would continue troubleshooting via the "Software" forum.

I don't have access to the machine in question right now, but I will post up the requested specifics as soon as I get a chance.

Thanks again for the reply :-)

politik 07-03-2010 10:01 AM

Quote:

Originally Posted by unSpawn (Post 4021449)
Can you be more specific and provide application details, posting version nfo and configuration details if deemed necessary?

I am using libpam-mount 1.32-2 to try and automatically mount shares on an XP machine at login, and automatically unmount the same XP shares at log out.

I have two groups on the Xubuntu machine:

xpsharesreadonly: if the user logging in is a member of this group, mount xpshare 1 and xpshare 2 as read only

xpsharesreadwrt: if the user logging in is a member of this group, mount xpshare 1, xpshare2, and xpshare3 as read write.



Quote:

Originally Posted by unSpawn (Post 4021449)
Could you post your /etc/pam.d PAM stack in which you use pam_mount?

Don't know what you mean by "post the etc/pam.d PAM stack" ? Should I be posting the contents of specific files ?


Quote:

Originally Posted by unSpawn (Post 4021449)
And your /etc/security/pam_mount.conf.xml and ~/.pam_mount.conf.xml? Not sure if it helps but the more nfo the better.

I chose not to allow per-user mounts, so there are no ~/.pam_mount.conf.xml files.

Here is etc/security/pam_mount.conf.xml:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<!--
See pam_mount.conf(5) for a description.
-->

<pam_mount>

<!-- debug should come before everything else,
since this file is still processed in a single pass
from top-to-bottom -->

<debug enable="1" />


<!-- Volume definitions -->

<!-- if you are a member of the group "xpsharesreadonly", then mount the XP share "share1" as read only -->


<volume options="user,ro,credentials=~/.smbcredentials"
fstype="cifs"
server="servername"
path="share1"
mountpoint="~/Music/servername_share1"
>

<sgrp>xpsharesreadonly</sgrp>

</volume>

<!-- pam_mount parameters: General tunables -->

<!--
<luserconf name=".pam_mount.conf.xml" />
-->

<!-- Note that commenting out mntoptions will give you the defaults.
You will need to explicitly initialize it with the empty string
to reset the defaults to nothing. -->
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<!--
<mntoptions deny="suid,dev" />
<mntoptions allow="*" />
<mntoptions deny="*" />
-->
<mntoptions require="nosuid,nodev" />
<path>/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin</path>

<logout wait="0" hup="0" term="0" kill="0" />


<!-- pam_mount parameters: Volume-related -->

<mkmountpoint enable="1" remove="true" />


</pam_mount>


I have the debug option set to 1 with this line:

<debug enable="1" />

which is supposed to enable logging to syslog but no pam_mount info is showing up in syslog.

I also indicated to automatically create the mount point at login, and delete the mount point at log out:

<mkmountpoint enable="1" remove="true" />

and when a user in group "xpsharesreadonly" logs in, the mount point is created (but the mount point is not deleted at log out), so it seems like pam_mount is actually working and processing the pam_mount.conf.xml file.

Thanks again for the help and let me know if there is any additional info you need.

politik 07-03-2010 10:12 AM

Additional note: I only have logic for the group xpsharesreadonly in my pam_mount.conf.xml file right now. Once I get that working, I'll add logic for the group xpsharesreadwrt.

politik 07-03-2010 10:28 AM

update: pam_mount is automatically creating the mount point at log in *and* automatically deleting the mount point at log off. So looks like pam_mout is at least installed correctly and processing the pam_mount.conf.xml file, but the share on the xp box still isn't mounting.

unSpawn 07-05-2010 04:24 PM

Since pam_mount works then if debug is still enabled please check the logs for anything related. If that doesn't show any problems and if the CLI cifsmount command works for the user who is logging in then if there isn't anything logged then I don't know, sorry.

politik 07-05-2010 07:03 PM

Quote:

Originally Posted by unSpawn (Post 4024582)
Since pam_mount works

pam_mount is automatically creating/deleting the mount point but the xp shares are not being mounted, so I wouldn't say pam_mount is "working"

I can mount the xp shares flawlessly from the command line, so I'm pretty sure it's not an issue with permissions or anything on the xp side. I am trying to use pam_mount to automate the mount process.

Quote:

Originally Posted by unSpawn (Post 4024582)
then if debug is still enabled please check the logs for anything related.

That was my original dilemma that I posted about before. As stated previously, I have logging enabled but nothing from pam_mount is being written to syslog. The only log that has any pam_mount related info is /var/logs/auth.log


All times are GMT -5. The time now is 03:21 AM.