Hi there,
I'm hoping there's someone here that can help me. I've only recently started using Revolution, so am something of a newbie where it's concerned, although not to programming in general. I've searched through the help and haven't found anything that would specifically address my query.
What I'd like to do is automatically detect if there are any mysql services installed on a Windows (and maybe other) machine, and if so, whether they're running or not.
My approach has been to loop through all registry keys under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ to look for instances where the ImagePath subkey contains text with 'mysql' in it and then work from there.
Where I'm stuck is detection of services/daemons on other platforms. If someone's done this before, I'd appreciate it if they could tell me a bit about how they approached the problem.
Thanks,
Will.
Service detection on Windows & ??? platform
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Hi Will,
On Unix and OS X you can find out whether a service is running by using the unix "ps" command.
If you execute the command "ps -ax", all the processes will be listed, you can filter this list by redirecting the output through the grep command. For example, to search for mysql processes, something like:
get shell("ps -ax | grep mysqld")
should return the information you need. You will need to do a small amount of work in Revolution to get the process ids that you need, and also to filter out the process id of the grep command itself.
Hope this helps.
Regards
Oliver
On Unix and OS X you can find out whether a service is running by using the unix "ps" command.
If you execute the command "ps -ax", all the processes will be listed, you can filter this list by redirecting the output through the grep command. For example, to search for mysql processes, something like:
get shell("ps -ax | grep mysqld")
should return the information you need. You will need to do a small amount of work in Revolution to get the process ids that you need, and also to filter out the process id of the grep command itself.
Hope this helps.
Regards
Oliver
Oliver Kenyon
Software Developer
Runtime Revolution
Software Developer
Runtime Revolution