I have an issues that is more annoying than problematic…
I have two displays that have a default layout (20s in length) that contains a command that puts the screen to sleep. The content we schedule then issues another command that wakes up the display. It works perfectly!
The problem is my logs. I see an error logged for each of those displays every 20 seconds…
“ProcessID empty for command:”
“ProcessID empty for command:”
“ProcessID empty for command:”
“ProcessID empty for command:”
“ProcessID empty for command:”
…and so forth…
How can I make it stop? It’s a short-running command so the process ID is probably hard to grab, which is why there is probably an error. The page associated with the command is [UI Thread] ShellCommand - TerminateCommand
I see… Where exactly would I find this option? I don’t see it when I edit the module, command, display setting, or command media item in the layout. Am I missing something?
Thanks, I see what you’re talking about now, but it’s not available with the way we have this configured. We’re triggering a globally configured command from the layout. As soon as we select the command to trigger that option goes away…
We’d prefer to retain the ability to keep the layouts platform agnostic. Is there a way to configure those additional settings without embedding the command into the layout itself.
We’re currently running 1.8.7 on windows 1.8.3-130.
I reviewed the multiple use cases that you outlined, but your list does not seem to include our current use case: Triggering a globally configured command via a layout Shell Command widget.
When selecting a globally configured command from the list, all of the below options are removed and only this remains:
Looking at the client source, it seems like an error is logged regardless of which options are selected:
Trace.WriteLine(new LogMessage("ShellCommand - TerminateCommand", _command), LogType.Info.ToString());
if (_processId == 0)
{
Trace.WriteLine(new LogMessage("ShellCommand - TerminateCommand", "ProcessID empty for command: " + _command), LogType.Error.ToString());
return;
}
if (_useTaskKill)
{
using (Process process = new Process())
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = "taskkill.exe";
startInfo.Arguments = "/pid " + _processId.ToString();
process.StartInfo = startInfo;
process.Start();
}
}
else
{
using (Process process = Process.GetProcessById(_processId))
{
process.Kill();
}
}
xibo-dotnetclient/Media/ShellCommand.cs @168
If the desired functionality is that a process ID is only raised to an error when the command needs to be killed, the error would need to be raised conditional on _useTaskKill. I’m not sure where the “Terminate the command once the duration elapses?” option is honored unless that determines the value of disposing passed to Dispose().
Thoughts?
In the meantime I am going to see if I can find a way to make the command return a process ID to satisfy the gods.
I’m glad that I was able to amuse you! I’m also glad that you may have root-caused the problem because I haven’t gotten around to implementing a work-around yet.