Custom Command not working but it used to work...

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

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?

It just says No output generated. No errors.

What if you run that using the Command Shell module (under the Others category) ?

It works perfect from there...

I wasn't able to re-produce this problem, sorry.

Does anything get logged to /var/webmin/miniserv.error when you click the button?

No, nothing relevant is logged to /var/webmin/miniserv.error

What if you just run some trivial command, like virtualmin list-domains to see if commands run at all?

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.

Ok, so does switching your other command to run as root solve this problem?

Yep, works correct as root.

Ok, sounds like this is fixed then.

Well, shouldn't this be able to run as webmin user? Any risks running all Custom Commands as root?

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.

Automatically closed -- issue fixed for 2 weeks with no activity.