wine command is not working in crontab
Paul Millar
paul at astro.gla.ac.uk
Fri Nov 18 13:37:27 CST 2005
Hi Charles,
OK, so what I suspect is happening is crontab has no DISPLAY variable set, so
wine is defaulting to using the ttydriver. Unfortunately, crontab
environment isn't attached to any tty, so that fails too with the error
message you see.
What you really want is the nulldriver (which I think Alexandre mentioned once
a while back) but that doesn't exist yet.
I'm not sure how to start up a pseudo-tty for your crontab entry. It should
be possible but I'm not sure if there's standard tools to achieve it.
What I do for WRT is start up a VNC for the duration, then shut it down again.
See script snippets below for some ideas. This should work for you, but its
something of a hammer to crack a nut.
I used to use Xvfb (from XFree86) as the (virtual) frame-buffer device and
have some scripts to support that. Unfortunately, that had a nasty habit of
crashing whenever one tried any openGL/glx stuff and the XF86 people weren't
interested in fixing the bugs.
HTH,
Paul.
Do something like:
crontab-script.sh:
#!/bin/bash
. /usr/local/share/wine/wine-functions # or wherever
eval $(startVNC)
wine some-prog.exe
eval $(stopVNC)
wine-functions:
function startVNC()
{
res=${XVFB_RESOLUTION:-1600x1200}
depth=${XVFB_DEPTH:-16}
disp=${XVFB_DISPLAY:-1}
$VNCDIR/vncserver :$disp -geometry ${res} -depth $depth
echo "export DISPLAY=:${disp};"
echo "echo vncserver up and running..."
}
function stopVNC()
{
disp=${XVFB_DISPLAY:-1}
$VNCDIR/vncserver -kill :$disp
echo "unset DISPLAY;"
echo "echo vncserver stopped."
}
Unfortunately, I had to patch vncserver script to stop it from writing to
~/.vnc. Here's the patch:
--- /usr/bin/vncserver Fri Feb 27 09:19:42 2004
+++ VNC/vncserver Sun Sep 25 21:18:34 2005
@@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
+# APM - 2005-05-13: work solely out of WRT directory. Unfortunately, this
+# requires patching this executable
#
# vncserver - wrapper script to start an X VNC server.
@@ -37,7 +39,7 @@
$depth = 24;
$desktopName = "X";
$vncClasses = "/usr/share/vnc/classes";
-$vncUserDir = "$ENV{HOME}/.vnc";
+$vncUserDir = "$ENV{VNCDIR}" || "$ENV{HOME}/.vnc";
$fontPath = "unix/:7100";
# Here is another example of setting the font path:
so, running this patched version of vncserver with VNCDIR set somewhere
writable by cron's userid should work.
On Friday 18 November 2005 07:09, Charles A wrote:
> I'm not able to use wine command in crontab it giving following error
> "Error opening terminal: unknown"
>
> I'm using wine 0.9, i have added following command in crontab
>
> 20 10 * * * /home/Maven/test.sh
>
> In the "test.sh" file has the following wine comments
>
> ssdir=/mnt/VSS-DB <!-- VSS DB mounted folder -->
> path=$path;......
>
> export ssdir
> export path
>
> wine "z:/mnt/winsys/Program Files/Microsoft Visual
> Studio/Common/VSS/win32/ss.exe" Workfold $/xyz/Development/src
> "z:/mnt/workfold/" -Yarunm,maven wine "z:/mnt/winsys/Program
> Files/Microsoft Visual Studio/Common/VSS/win32/ss.exe" get
> $/xyz/Development/src -yarunm,maven -R -f
>
>
> I got tired of flailing in the drak, please correct me where i'm
> wrong....!!!
>
> Thanks & Regards
> charles
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20051118/514ad0c6/attachment.pgp
More information about the wine-devel
mailing list