Softaculous


Topic : recipe


1

Posted By: tashkas on January 14, 2019, 7:53 pm
how those recipies works, do i have to turn off and start vps? when i do so i dont get any action of it.

Posted By: wolke on January 14, 2019, 8:08 pm | Post: 1
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.

Posted By: tashkas on January 14, 2019, 9:03 pm | Post: 2
how i can make that one run on vps creation?

Posted By: wolke on January 15, 2019, 6:43 am | Post: 3
Simply select it under the "Advanced options" section when creating a server. There is an option called "recipe".

Posted By: tashkas on February 20, 2019, 5:59 pm | Post: 4
is there such thing to install recipie on vps started?

Posted By: wolke on February 20, 2019, 8:24 pm | Post: 5
nope

Posted By: shawn.horton on March 12, 2019, 5:24 pm | Post: 6
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.


Posted By: wolke on March 13, 2019, 8:41 am | Post: 7
thanks for sharing this!

Posted By: tashkas on March 16, 2019, 4:14 pm | Post: 8
how to make this line to work in recipie?

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

Posted By: wolke on March 16, 2019, 7:51 pm | Post: 9
maybe that way:

just a thought.


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

Posted By: shawn.horton on March 16, 2019, 8:13 pm | Post: 10
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.

Posted By: tashkas on March 16, 2019, 8:37 pm | Post: 11
nope not installing it either with 20sec, it should pop up in first installation when ssh have been accessed.

Posted By: shawn.horton on March 16, 2019, 9:00 pm | Post: 12
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.

Posted By: tashkas on March 16, 2019, 9:06 pm | Post: 13
sorry no such process runing.

Posted By: shawn.horton on March 16, 2019, 9:16 pm | Post: 14
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.

Posted By: tashkas on March 16, 2019, 9:25 pm | Post: 15
no output

Posted By: gamingserv on March 30, 2019, 8:05 pm | Post: 16
Simple recipes dont work for my....
Code

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

Posted By: wolke on March 31, 2019, 11:54 am | Post: 17
Please remove the first line
Code
#!/bin/sh
It is added automatically.

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

Posted By: tashkas on April 1, 2019, 9:57 am | Post: 18
is it possible to make run script on first ssh login?

Posted By: wolke on April 1, 2019, 10:36 am | Post: 19
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.


Posted By: wolke on July 5, 2019, 4:47 pm | Post: 20
FYI: as of today (Virtualizor release 3), recipe can be executed on vm rebuild also. That was not possible before.

Posted By: m3gatr0n on November 1, 2019, 9:06 pm | Post: 21
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.

Posted By: miyabhai101 on January 13, 2020, 11:28 am | Post: 22

Thank you very much for sharing

-----------------------
tubemate mobdro authorityapk

Posted By: wolke on January 13, 2020, 12:58 pm | Post: 23
@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.

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.