Welcome Guest. Please Login or Register  


You are here: Index > Virtualizor - Virtual Server Control Panel > General Support > Topic : recipe

1


Threaded Mode | Print  

 recipe, recipe (23 Replies, Read 21981 times)
tashkas
Group: NOC
Post Group: Newbie
Posts: 24
Status:
how those recipies works, do i have to turn off and start vps? when i do so i dont get any action of it.
IP: --   

recipe
wolke
Group: NOC
Post Group: Elite Member
Posts: 437
Status:
recipes will be executed only while creating the vps (if a recipe is selected to run)  and through the enduser panel.It will not be executed when you rebuild the server.
IP: --   

recipe
tashkas
Group: NOC
Post Group: Newbie
Posts: 24
Status:
how i can make that one run on vps creation?
IP: --   

recipe
wolke
Group: NOC
Post Group: Elite Member
Posts: 437
Status:
Simply select it under the "Advanced options" section when creating a server. There is an option called "recipe".
IP: --   

recipe
tashkas
Group: NOC
Post Group: Newbie
Posts: 24
Status:
is there such thing to install recipie on vps started?
IP: --   

recipe
wolke
Group: NOC
Post Group: Elite Member
Posts: 437
Status:
nope
IP: --   

recipe
shawn.horton
Group: Member
Post Group: Newbie
Posts: 4
Status:
After messing with these for a while I did find an issue that keeps some recipes from running correctly.  If your recipe requires internet access it will fail because the recipe is fired before the network is up and running.  My solution to this is to put a sleep command in my script for 20-30 seconds.  I notified support and they verified that it is a bug.

IP: --   

recipe
wolke
Group: NOC
Post Group: Elite Member
Posts: 437
Status:
thanks for sharing this!
IP: --   

recipe
tashkas
Group: NOC
Post Group: Newbie
Posts: 24
Status:
how to make this line to work in recipie?

bash <(wget -O- -q https://raw.githubusercontent.com/liaralabs/swizzin/master/setup.sh)
IP: --   

recipe
wolke
Group: NOC
Post Group: Elite Member
Posts: 437
Status:
maybe that way:

just a thought.


Edited by wolke : March 16, 2019, 7:51 pm
IP: --   

recipe
shawn.horton
Group: Member
Post Group: Newbie
Posts: 4
Status:
Quote From : wolke March 16, 2019, 7:51 pm
maybe that way:

just a thought.


I would add sleep first if you have a problem with the script failing due to no network.
IP: --   

recipe
tashkas
Group: NOC
Post Group: Newbie
Posts: 24
Status:
nope not installing it either with 20sec, it should pop up in first installation when ssh have been accessed.
IP: --   

recipe
shawn.horton
Group: Member
Post Group: Newbie
Posts: 4
Status:
Quote From : tashkas March 16, 2019, 8:37 pm
nope not installing it either with 20sec, it should pop up in first installation when ssh have been accessed.


Recipes run as root on startup independent of your ssh login.  The script you are using is interactive and may be waiting for input in the console session itnis running in.  If you look at your running processes you should see setup.sh idled waiting for input.  If you can attach to the console where it is running you should be able to complete the process.

Run your script in an ssh session and you will see the waiting input.  You might be able to do some echo commands as part of the recipe to answer the prompts.
IP: --   

recipe
tashkas
Group: NOC
Post Group: Newbie
Posts: 24
Status:
sorry no such process runing.
IP: --   

recipe
shawn.horton
Group: Member
Post Group: Newbie
Posts: 4
Status:
Create a bash script, and paste the contents of your recipe inside. 
Run the script from the command line and see what it does.

Once it works as expected on the command line then look at updating the recipe.
IP: --   

recipe
tashkas
Group: NOC
Post Group: Newbie
Posts: 24
Status:
no output
IP: --   

recipe
gamingserv
Group: Member
Post Group: Newbie
Posts: 5
Status:
Simple recipes dont work for my....
Code

#!/bin/sh
sleep 30
apt install htop -y
IP: --   

recipe
wolke
Group: NOC
Post Group: Elite Member
Posts: 437
Status:
Please remove the first line
Code
#!/bin/sh
It is added automatically.

Edited by wolke : March 31, 2019, 11:54 am
IP: --   

recipe
tashkas
Group: NOC
Post Group: Newbie
Posts: 24
Status:
is it possible to make run script on first ssh login?
IP: --   

recipe
wolke
Group: NOC
Post Group: Elite Member
Posts: 437
Status:
Not with the built in function.
The following will work only with ssh login with key, not password.
1.add a "command=/path/to/your/script" at the end of your access key stored in authorized_keys.
2. Add a recipe in virtualizor that writes your desired script to the path above and issue a

Code
chmod +x /path/to/your/script

3. Whenever there is a login with the matched key, the script will be executed.
If you only needs this to run ONCE, you need to delete the script and change the key (remove the command=" sectionl. The script can also delete itself with simple

Code
rm /path/to/your/script

command as last line.
That´s just a suggestion which can be refined further.

IP: --   

recipe
wolke
Group: NOC
Post Group: Elite Member
Posts: 437
Status:
FYI: as of today (Virtualizor release 3), recipe can be executed on vm rebuild also. That was not possible before.
IP: --   

recipe
m3gatr0n
Group: Member
Post Group: Newbie
Posts: 1
Status:
Where I can find some documentation related to it.
I would like to know if I can use variables inside recipe like user email address or something.
Also I would like to know at which run-level the recipe will run.
IP: --   

recipe
miyabhai101
Group: Member
Post Group: Newbie
Posts: 2
Status:

Thank you very much for sharing

-----------------------
tubemate mobdro authorityapk
IP: --   

recipe
wolke
Group: NOC
Post Group: Elite Member
Posts: 437
Status:
@m3gatr0n
   

a recipe is a shell script which is running under the root user the same way as if it has been started locally on a console.
IP: --   

« Previous    Next »

Threaded Mode | Print  

1


Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is April 29, 2024, 11:41 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.046