Submitted by isdahlc on Mon, 09/08/2014 - 09:22 Pro Licensee
Hi Guys,
I have the following custom command setup in Virtualmin, it just lists usernames and passwords. This used to work fine but suddently doesn't work anymore. I've checked and rechecked it and it seems correct. Can you point out what I'm missing? Thanks!
virtualmin list-users --domain $domain --multiline | grep "Unix username\|Password\|Forward mail to" | sed 's/Unix username/Username/g'
In fact, I can copy/paste the above command onto the command line at it works perfectly. Note $domain is a parameter on the Custom Command screen.
Status:
Closed (fixed)
Comments
Submitted by andreychek on Mon, 09/08/2014 - 09:31 Comment #1
Howdy -- do you receive an error of some kind of trying to run the above command? Do any errors show up in /var/webmin/miniserv.error?
Submitted by isdahlc on Mon, 09/08/2014 - 10:52 Pro Licensee Comment #2
It just says
No output generated
. No errors.Submitted by JamieCameron on Mon, 09/08/2014 - 12:06 Comment #3
What if you run that using the Command Shell module (under the Others category) ?
Submitted by isdahlc on Mon, 09/08/2014 - 13:30 Pro Licensee Comment #4
It works perfect from there...
Submitted by JamieCameron on Mon, 09/08/2014 - 15:12 Comment #5
I wasn't able to re-produce this problem, sorry.
Does anything get logged to /var/webmin/miniserv.error when you click the button?
Submitted by isdahlc on Thu, 09/11/2014 - 09:08 Pro Licensee Comment #6
No, nothing relevant is logged to /var/webmin/miniserv.error
Submitted by JamieCameron on Thu, 09/11/2014 - 13:11 Comment #7
What if you just run some trivial command, like
virtualmin list-domains
to see if commands run at all?Submitted by isdahlc on Thu, 09/11/2014 - 15:15 Pro Licensee Comment #8
When I set it up in Custom Command It told me I had to run the command as root, so I did that. Worked perfectly, came back with a list of domains.
I know I have 2 issues open, this is a different server than the one with the awstats issue. Just wanted to make that clear.
Submitted by JamieCameron on Thu, 09/11/2014 - 16:50 Comment #9
Ok, so does switching your other command to run as root solve this problem?
Submitted by isdahlc on Thu, 09/11/2014 - 17:31 Pro Licensee Comment #10
Yep, works correct as root.
Submitted by JamieCameron on Thu, 09/11/2014 - 19:50 Comment #11
Ok, sounds like this is fixed then.
Submitted by isdahlc on Thu, 09/11/2014 - 20:56 Pro Licensee Comment #12
Well, shouldn't this be able to run as webmin user? Any risks running all Custom Commands as root?
Submitted by JamieCameron on Thu, 09/11/2014 - 23:50 Comment #13
All Virtualmin API commands need to run as
root
. There shouldn't be any risk granting permissions to run commands to other Webmin users though ... as long as they can't create new commands.Submitted by Issues on Thu, 09/25/2014 - 23:51 Comment #14
Automatically closed -- issue fixed for 2 weeks with no activity.