Open wingfeng opened 7 years ago
I would probably execute the command like this.
yum install squid -y && service squid start
Let me know if this works for you.
It is'nt work at my side as my posted at the end.
I don't understand your reply.
The original post contains a different invocation of the command. I don't know why that would indicate a differently formatted command would fail.
I try to do a simple things with CustomScriptForLiunx. Step 1 :install squid Step 2 : start squid service so I use this command in CustomScriptForlinux $settings='{"commandToExecute":"yum install squid -y;service squid start"}' after I run the powershell command Set-AzureRmVMExtension -ResourceGroupName -VMName vmsquid -Publisher "Microsoft.OSTCExtensions" -TypeHandlerVersion "1.5" -ExtensionType "CustomScriptForLinux" -SettingString $settings -DisableAutoUpgradeMinorVersion -Name SSHExtension -Location "China North"
I didn't get an output a my expected:The squid installed and started. I got a message as below:
---stdout--- Loaded plugins: fastestmirror, security Setting up Install Process Loading mirror speeds from cached hostfile No package squid;service available. No package start available. Resolving Dependencies --> Running transaction check ---> Package squid.x86_64 7:3.1.23-16.el6_8.6 will be installed --> Finished Dependency Resolution Dependencies Resolved
It work like the second command "service squid start" became a part of the first command "yum" I also try to use command "yum install squid -y && service squid start" and yum install squid -y |service squid start" But I got the same problem. My VM is CentOS 6.6