LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-19-2022, 07:01 AM   #31
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930

Quote:
Originally Posted by riahc3 View Post
"UNKNOWN: Mount did not work"

😂 Obviously, Im not surprised.
This goes back to, does the mount command as written in the script, work if you issue it manually from the command line.

Sorry pan64 is correct about how to check the return status of mount.
 
Old 05-19-2022, 07:03 AM   #32
riahc3
Member
 
Registered: Dec 2002
Posts: 223

Original Poster
Rep: Reputation: 1
Mount is working but it seems umount isnt.
 
Old 05-19-2022, 08:15 AM   #33
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,869

Rep: Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314
I guess umount needs sudo too.
 
Old 05-19-2022, 08:16 AM   #34
riahc3
Member
 
Registered: Dec 2002
Posts: 223

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by rtmistler View Post
This goes back to, does the mount command as written in the script, work if you issue it manually from the command line.
Yes but the user is not the same, as I stated.
 
Old 05-19-2022, 08:20 AM   #35
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,869

Rep: Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314Reputation: 7314
Quote:
Originally Posted by riahc3 View Post
Yes but the user is not the same, as I stated.
? which user is not the same?
 
Old 05-19-2022, 11:20 PM   #36
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
It is quite possible to add a user (or group) to the sudoers and limit the command or commands to exactly what is specified in the sudoers file. This way you can specifically tailor allowing something to be done as root by that user but have it detailed enough to do exactly what is allowed and no more.

I would consider using that method to allow the mount and umount commands in your script to be run as that user, allowing it to mount and dismount that share, and still limit what that user can do.

Read up on the sudoers file structure and config and you will see what I mean.

The system requires that mount and umount be done as root (except for specific cases that may be done with entries in /etc/fstab, but that is another whole conversation)

Last edited by computersavvy; 05-19-2022 at 11:22 PM.
 
Old 05-20-2022, 02:54 AM   #37
riahc3
Member
 
Registered: Dec 2002
Posts: 223

Original Poster
Rep: Reputation: 1
mount and umount work

But the script doesnt seem to be working....Hmmm

<Code removed>


And it does not enter into the conditions I set

Last edited by riahc3; 05-20-2022 at 03:06 AM.
 
Old 05-20-2022, 03:04 AM   #38
riahc3
Member
 
Registered: Dec 2002
Posts: 223

Original Poster
Rep: Reputation: 1
Never mind. All is working

Thanks for all the ideas and tips

Last edited by riahc3; 05-20-2022 at 03:49 AM.
 
Old 05-20-2022, 09:13 AM   #39
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Would you please post the detailed actual fix. We are presently left guessing what the solution was and nothing to tell a reader in the future how you solved the problem.
 
1 members found this post helpful.
  


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
My LG Stylo 4 Has Been Hijacked by Remote Administrator and OS as Well as Kernel Have Been Modified LongDuckDong_69 Linux - Newbie 3 11-17-2019 03:41 PM
How to find a file that's modified more than 2 days ago but less than 5 days BudiKusasi Linux - Newbie 1 02-09-2018 07:25 PM
file has been modified in the last minute charleswilliams Linux - Server 1 08-25-2013 05:59 PM
[bash] Seeing if a file has been modified before/after a date w3stfa11 Programming 7 10-15-2006 06:02 PM
Get directory stats when a file has been modified? marri Programming 2 05-13-2004 08:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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