I'm trying to create a cron job to prevent children at a school from running the Minecraft server. (We actually need them to run the Minecraft client because we use it to teach programming.) The name of the PROCESS is always "java". That's not useful for me.
I found a way using jps
and lsof
of getting the filesize of all running .jar files. I could kill processes based on that, but it seems messy.
The name of the Application (not the process) that runs the Minecraft server (as show by the Apple logo on the top left corner of the screen) AND its Java class name are both net.minecraft.server.MinecraftServer but I can't ever get that string from the command line, no matter how many variations of ps
I try. ps
and top
always call the process "java". It's easy to find the file name being used, but that's useless because it's easily modified.
Is there a good, clean way to find if the Application or Java class net.minecraft.server.MinecraftServer is running and what its process is?