[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Rebuilding catalog cgi thru web
****** message to minivend-users from jojo@buchonline.net ******
On 17 May, Dennis Duval wrote:
> ****** message to minivend-users from "Dennis Duval" <skip-minivend@seacove.net> ******
>
>>
>> I'm just curious about the
>> $cmd = 'su -c /minivend/mvend/bin/restart minivend';
>> isn't the next thing that happens is you are prompted for
>> a root password? Depending on UNIX system this is on.
>>
> Yes, you are exactly right. I was running my little command line script as
> root, so I neglected to see that it would ask for a password if run as a
> different user. However it still doesn't solve the problem of restarting
> minivend if I use a command like:
>
> $cmd = 'minivend/mvend/bin/restart'
>
> This one works from the command line without giving a password prompt and
> actually restarts minivend if run as the same user as minivend but will not
> work from the web app.
>
> Dennis Duval
Why not
- write a little shell script "RestartMVbyCrontab.sh" like
----------snip--------
#!/bin/sh
file="/www/yourwebspace/catalogs/yourshop/pages/log/restartmv.log"
if /bin/cat ${file} | /usr/bin/grep "Dennis" > /dev/null
then
rm ${dir}
/path-to-minivend-bin-dir/restart
/usr/bin/mail -s "Restart Minivend" <yourusername>
fi
----------snip--------
- using a crontab with the above shell script
- create a directory pages/log
- copy the .access and .access_gate files into the directory pages/log
with
-----------snip-------------
restart: [if session username eq 'Dennis']Yes[else]No[/else][/if]
logrestart: [if session username eq 'Dennis']Yes[else]No[/else][/if]
*: 0
-----------snip-------------
- create a Minivend pages restart.html like
-------------snipp-------------
<HTML><HEAD><TITLE></TITLE></HEAD>
<BODY LINK="#006666" ALINK="#FF0000" VLINK="#669999" TEXT="#000000" BGCOLOR="#FFFFFF">
[if session logged_in]
<BR>
<BR>
<FORM ACTION="[process-target secure=1]" METHOD=POST>
<input type="hidden" name="mv_nextpage" value="wallin">
<B>[L]Hi[/L] [value name]!</B><BR><BR>
[L]You are logged in as user[/L] <B>[value mv_username]</B><BR><BR>
<INPUT TYPE=submit NAME="mv_click" VALUE="Log out">
</FORM>
<BR>
[if session username eq 'Dennis']
[page log/logrestart]Let Crontab to restart the Minivend[/page]
[/if]
<BR>
[set Log out]
mv_todo=return
[userdb function=logout clear=1]
mv_username=[value mv_username]
[/set]
<BR><BR>
[else]
[set Login]
mv_todo=return
[userdb login]
[/set]
[if session failure]
Error: [data session failure]
[/if]
<FORM ACTION="[process-target secure=1]" METHOD=POST>
<INPUT TYPE="hidden" NAME="mv_click" VALUE="Login">
<INPUT TYPE="hidden" NAME="mv_doit" VALUE="return">
<INPUT TYPE="hidden" NAME="mv_nextpage" VALUE="wallin">
[L]Username[/L] <INPUT NAME="mv_username" VALUE="[value mv_username]" SIZE=10>
[L]Password[/L] <INPUT onChange="this.form.submit()" TYPE="password" NAME="mv_password" VALUE="" SIZE=10>
<INPUT TYPE=submit Value="Log in">
</FORM>
[/else]
[/if]
</BODY>
</html>
-----------snip-------------
- create a file logrestart.html like
---------snipp----------
[set logtime interpolate=1][tag time]%A, %B %d, %Y[/tag][/set]
[tag op=log file="pages/log/restartmv.log" interpolate=1]
[scratch logtime] login: [value mv_username]
[/tag]
[tag op=header interpolate=1]
Status: 302 moved
Content-type: text/html
Location: [area href="catalog" secure=1]
[/tag][set mv_no_cache]1[/set]
---------snipp----------
or with MV4
---------snipp----------
[set logtime interpolate=1][tag time]%A, %B %d, %Y[/tag][/set]
[tag arg="pages/log/restartmv.log" op=log interpolate=1]
[scratch logtime] login: [value mv_username]
[/tag]
[tag op=header interpolate=1]
Status: 302 moved
Content-type: text/html
Location: [area href="catalog" secure=1]
[/tag][set mv_no_cache]1[/set]
---------snipp----------
Make sure, you use the makecat script and restart the MV Server first
before using my suggestion.
Regards,
Joachim
--
Hans-Joachim Leidinger
buch online jojo@buchonline.net
Munscheidstr. 14 FAX: +49 209 1671449
45886 Gelsenkirchen FAX: 0209 1671449
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list