LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-12-2009, 07:05 AM   #1
nglbrkr
Member
 
Registered: May 2005
Location: hiroshima
Distribution: debian
Posts: 75
Blog Entries: 9

Rep: Reputation: 17
script works, shortcut doesn't


I'm trying to get user homes from the central (debian) server mounted on some shared Dell minis.

I have to pass username and directory to the server, so I adapted a little script that looks like this:

#! /bin/sh
echo -n "user name: "
read user
echo -n "year: "
read year
sshfs $user@server.domain:/path/to/homes/$year/$user ~/myhome
exit

If I run this script in a terminal, it works correctly - the server prompts for password and the share is mounted.

I created a shortcut to the script on the desktop.
When I click the shortcut, Gnome asks what to do and I choose "run in terminal".
The script runs and prompts for username, year and the server prompts for password. Then the terminal closes. However the share is NOT mounted.

Any idea what is going wrong?

thanks

nigel
 
Old 02-12-2009, 07:33 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
nothing off hand, but put some logging statements into it to see what the variables actually are taken as during exectution, log the sshfs command output etc... if you go from:


sshfs $user@server.domain:/path/to/homes/$year/$user ~/myhome

to

echo about to run sshfs $user@server.domain:/path/to/homes/$year/$user ~/myhome | logger
sshfs $user@server.domain:/path/to/homes/$year/$user ~/myhome 2>&1 | logger

then you'll have a lot more info in /var/log/messages to make sense of.
 
Old 02-12-2009, 11:46 PM   #3
nglbrkr
Member
 
Registered: May 2005
Location: hiroshima
Distribution: debian
Posts: 75

Original Poster
Blog Entries: 9

Rep: Reputation: 17
I received a suggestion that sshfs was dying when the terminal closed.
Adding nohup to the mount command fixed it (though I get some extra messages and a nohup.out file on the desktop)
Thanks for the help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
howto KDE KB shortcut to a script that output texts ? DaveQB Linux - Desktop 2 06-22-2008 04:02 AM
Creating a desktop shortcut with a script file ben44b Linux - Newbie 5 01-07-2007 07:24 PM
shell script link/shortcut in KDE sanger440 Linux - Newbie 7 02-12-2004 05:37 PM
Wine Shortcut Script Streams Linux - Software 4 05-19-2003 05:08 PM
script and makin' a shortcut jefftrwmy Linux - Software 1 05-13-2002 07:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration