Trying to run Gunicorn on the server gives Error - linux

from app import app as application
if __name__ == "__main__":
application.run(host='0.0.0.0')
Mar 31 10:48:52 guest gunicorn[115225]: raise HaltServer(reason, self.APP_LOAD_ERROR)
Mar 31 10:48:52 guest gunicorn[115225]: gunicorn.errors.HaltServer: <HaltServer 'App failed to load.' 4>
Mar 31 10:48:52 guest systemd[1]: app.service: Main process exited, code=exited, status=1/FAILURE
Mar 31 10:48:52 guest systemd[1]: app.service: Failed with result 'exit-code'.

Related

problems starting service that runs a bash script that in turn runs a python script

I have the following service file, enable, and start files located in /home/pi/poolboy/service:
[Unit]
Description=Pool Boy
After=network-online.target
[Service]
ExecStart=/home/pi/poolboy/start
WorkingDirectory=/home/pi/poolboy
StandardOutput=inherit
StandardError=inherit
Restart=always
[Install]
WantedBy=multi-user.target
I have an "enable" script to install it:
#!/bin/bash
sudo cp /home/pi/poolboy/service/poolboy.service /lib/systemd/system/
sudo systemctl enable poolboy.service
I have a "start" script to start the service:
#!/bin/bash
sudo systemctl start poolboy.service
the actual start script that runs the application (and is called by the service) is located in /home/pi/poolboy:
#!/bin/bash
cd "$(dirname "$0")"
VENV=venv
echo 'checking for ' $VENV
if [ ! -d $VENV ]
then
echo $VENV ' does not exist... initially creating it'
python3 -m venv $VENV
echo 'activating the virtual environment'
source venv/bin/activate
echo 'installing libraries from requirements.txt'
pip3 install -r requirements.txt
else
source $VENV/bin/activate
fi
echo 'starting...'
sudo $VENV/bin/python3 poolboy.py --standalone
After running the enable script I run the start script. I get the following output in my /var/log/syslog:
Jun 19 22:10:43 poolboy systemd[1]: Started Pool Boy.
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Main process exited, code=exited, status=200/CHDIR
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Failed with result 'exit-code'.
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Service RestartSec=100ms expired, scheduling restart.
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Scheduled restart job, restart counter is at 1.
Jun 19 22:10:43 poolboy systemd[1]: Stopped Pool Boy.
Jun 19 22:10:43 poolboy systemd[1]: Started Pool Boy.
Jun 19 22:10:43 poolboy systemd[4980]: poolBoy.service: Changing to the requested working directory failed: No such file or directory
Jun 19 22:10:43 poolboy systemd[4980]: poolBoy.service: Failed at step CHDIR spawning /usr/bin/python3: No such file or directory
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Main process exited, code=exited, status=200/CHDIR
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Failed with result 'exit-code'.
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Service RestartSec=100ms expired, scheduling restart.
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Scheduled restart job, restart counter is at 2.
Jun 19 22:10:43 poolboy systemd[1]: Stopped Pool Boy.
Jun 19 22:10:43 poolboy systemd[1]: Started Pool Boy.
Jun 19 22:10:43 poolboy systemd[4981]: poolBoy.service: Changing to the requested working directory failed: No such file or directory
Jun 19 22:10:43 poolboy systemd[4981]: poolBoy.service: Failed at step CHDIR spawning /usr/bin/python3: No such file or directory
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Main process exited, code=exited, status=200/CHDIR
Jun 19 22:10:43 poolboy systemd[1]: poolBoy.service: Failed with result 'exit-code'.
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Service RestartSec=100ms expired, scheduling restart.
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Scheduled restart job, restart counter is at 3.
Jun 19 22:10:44 poolboy systemd[1]: Stopped Pool Boy.
Jun 19 22:10:44 poolboy systemd[1]: Started Pool Boy.
Jun 19 22:10:44 poolboy systemd[4982]: poolBoy.service: Changing to the requested working directory failed: No such file or directory
Jun 19 22:10:44 poolboy systemd[4982]: poolBoy.service: Failed at step CHDIR spawning /usr/bin/python3: No such file or directory
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Main process exited, code=exited, status=200/CHDIR
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Failed with result 'exit-code'.
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Service RestartSec=100ms expired, scheduling restart.
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Scheduled restart job, restart counter is at 4.
Jun 19 22:10:44 poolboy systemd[1]: Stopped Pool Boy.
Jun 19 22:10:44 poolboy systemd[4984]: poolBoy.service: Changing to the requested working directory failed: No such file or directory
Jun 19 22:10:44 poolboy systemd[1]: Started Pool Boy.
Jun 19 22:10:44 poolboy systemd[4984]: poolBoy.service: Failed at step CHDIR spawning /usr/bin/python3: No such file or directory
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Main process exited, code=exited, status=200/CHDIR
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Failed with result 'exit-code'.
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Service RestartSec=100ms expired, scheduling restart.
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Scheduled restart job, restart counter is at 5.
Jun 19 22:10:44 poolboy systemd[1]: Stopped Pool Boy.
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Start request repeated too quickly.
Jun 19 22:10:44 poolboy systemd[1]: poolBoy.service: Failed with result 'exit-code'.
Jun 19 22:10:44 poolboy systemd[1]: Failed to start Pool Boy.
After replacing poolBoy with poolboy, it looks better, but the application is still not starting:
Jun 20 11:09:28 poolboy systemd[1]: Started Pool Boy.
Jun 20 11:09:28 poolboy start[1373]: checking for venv
Jun 20 11:09:28 poolboy start[1373]: starting...
Jun 20 11:09:28 poolboy systemd[1]: poolboy.service: Succeeded.
Jun 20 11:09:58 poolboy systemd[1]: poolboy.service: Service RestartSec=30s expired, scheduling restart.
Jun 20 11:09:58 poolboy systemd[1]: poolboy.service: Scheduled restart job, restart counter is at 12.
Jun 20 11:09:58 poolboy systemd[1]: Stopped Pool Boy.
Jun 20 11:09:58 poolboy systemd[1]: Started Pool Boy.
Jun 20 11:09:58 poolboy start[1447]: checking for venv
Jun 20 11:09:58 poolboy start[1447]: starting...
Jun 20 11:09:58 poolboy systemd[1]: poolboy.service: Succeeded.
Jun 20 11:10:28 poolboy systemd[1]: poolboy.service: Service RestartSec=30s expired, scheduling restart.
Jun 20 11:10:28 poolboy systemd[1]: poolboy.service: Scheduled restart job, restart counter is at 13.
Jun 20 11:10:28 poolboy systemd[1]: Stopped Pool Boy.
Jun 20 11:10:28 poolboy systemd[1]: Started Pool Boy.
Jun 20 11:10:28 poolboy start[1521]: checking for venv
Jun 20 11:10:28 poolboy start[1521]: starting...
Jun 20 11:10:28 poolboy systemd[1]: poolboy.service: Succeeded.
Jun 20 11:10:58 poolboy systemd[1]: poolboy.service: Service RestartSec=30s expired, scheduling restart.
Jun 20 11:10:58 poolboy systemd[1]: poolboy.service: Scheduled restart job, restart counter is at 14.
Jun 20 11:10:58 poolboy systemd[1]: Stopped Pool Boy.
Jun 20 11:10:58 poolboy systemd[1]: Started Pool Boy.
Jun 20 11:10:59 poolboy start[1595]: checking for venv
Jun 20 11:10:59 poolboy start[1595]: starting...
Jun 20 11:10:59 poolboy systemd[1]: poolboy.service: Succeeded.
Jun 20 11:11:01 poolboy kernel: [ 458.537483]
Jun 20 11:11:01 poolboy kernel: [ 458.537513] WARN::dwc_otg_hcd_urb_dequeue:639: Timed out waiting for FSM NP transfer to complete on 5
Jun 20 11:11:13 poolboy kernel: [ 470.441646]
Jun 20 11:11:13 poolboy kernel: [ 470.441682] WARN::dwc_otg_hcd_urb_dequeue:639: Timed out waiting for FSM NP transfer to complete on 5
Jun 20 11:11:29 poolboy systemd[1]: poolboy.service: Service RestartSec=30s expired, scheduling restart.
Jun 20 11:11:29 poolboy systemd[1]: poolboy.service: Scheduled restart job, restart counter is at 15.
Jun 20 11:11:29 poolboy systemd[1]: Stopped Pool Boy.
Jun 20 11:11:29 poolboy systemd[1]: Started Pool Boy.
Jun 20 11:11:29 poolboy start[1670]: checking for venv
Jun 20 11:11:29 poolboy start[1670]: starting...
Jun 20 11:11:29 poolboy systemd[1]: poolboy.service: Succeeded.
Any suggestions?
duh... my /home/pi/poolboy/start script had an & in the last line :-/
Now working with the above files

Executable which I am trying to run from a daemon script intermittently becomes inaccessible

I have a script written which tries to restart an executable if it is detected as stopped. However on occassion the script is unable to find the executable file, and it becomes accessible as soon as I log back into the machine using putty. Below are the logs for the phenomenon I am trying to describe.
Aug 4 23:41:24 USERNAME systemd[1]: my-scheduler.service: Service hold-off time over, scheduling restart.
Aug 4 23:41:24 USERNAME scheduler_startup[13535]: /usr/local/bin/scheduler_startup.sh: line 3: cd: /home/myUser/myFolder/Scheduler/dist/: No such file or directory
Aug 4 23:41:24 USERNAME scheduler_startup[13535]: /usr/local/bin/scheduler_startup.sh: line 4: ./Schedulercode: No such file or directory
Aug 4 23:41:24 USERNAME systemd[1]: my-scheduler.service: Main process exited, code=exited, status=127/n/a
Aug 4 23:41:24 USERNAME systemd[1]: my-scheduler.service: Unit entered failed state.
Aug 4 23:41:24 USERNAME systemd[1]: my-scheduler.service: Failed with result 'exit-code'.
Aug 4 23:41:29 USERNAME systemd[1]: my-scheduler.service: Service hold-off time over, scheduling restart.
Aug 4 23:41:29 USERNAME scheduler_startup[14213]: /usr/local/bin/scheduler_startup.sh: line 3: cd: /home/myUser/myFolder/Scheduler/dist/: No such file or directory
Aug 4 23:41:29 USERNAME scheduler_startup[14213]: /usr/local/bin/scheduler_startup.sh: line 4: ./Schedulercode: No such file or directory
Aug 4 23:41:29 USERNAME systemd[1]: my-scheduler.service: Main process exited, code=exited, status=127/n/a
Aug 4 23:41:29 USERNAME systemd[1]: my-scheduler.service: Unit entered failed state.
Aug 4 23:41:29 USERNAME systemd[1]: my-scheduler.service: Failed with result 'exit-code'.
Aug 4 23:41:35 USERNAME systemd[1]: my-scheduler.service: Service hold-off time over, scheduling restart.
Aug 4 23:41:35 USERNAME scheduler_startup[14889]: /usr/local/bin/scheduler_startup.sh: line 3: cd: /home/myUser/myFolder/Scheduler/dist/: No such file or directory
Aug 4 23:41:35 USERNAME scheduler_startup[14889]: /usr/local/bin/scheduler_startup.sh: line 4: ./Schedulercode: No such file or directory
Aug 4 23:41:35 USERNAME systemd[1]: my-scheduler.service: Main process exited, code=exited, status=127/n/a
Aug 4 23:41:35 USERNAME systemd[1]: my-scheduler.service: Unit entered failed state.
Aug 4 23:41:35 USERNAME systemd[1]: my-scheduler.service: Failed with result 'exit-code'.
Aug 4 23:41:40 USERNAME systemd[1]: my-scheduler.service: Service hold-off time over, scheduling restart.
Aug 4 23:41:41 USERNAME scheduler_startup[15313]: Scheduler Start - Version = 1.15 #Time: 2021-08-04 23:41:41.805467
As you can see on the last 2 lines, the restart attempt was successful and the application started running as expected. I am trying to find out what causes this temporary blindness to the executable in the system? and why is the file found again as soon as I log back in?
I am using is Ubuntu 20.xx

ceph-mon fails to start on rasberry pi (raspbian 8.0)

I recently purchased 3 raspberry pi nodes to create a small storage cluster to test with at my home. I found a couple of procedures on setting this up so it appears folks have successfully done this!
I am running Raspbian GNU/Linux 8.0 (jessie). I'm using ceph-deploy to install the cluster and it appears to install version 10.2.5-7.2+rpi1 of the ceph ARM packages.
When I try to start the ceph-mon service I get the following error from systemd:
Dec 14 19:59:46 ceph-master systemd[1]: Starting Ceph cluster monitor daemon...
Dec 14 19:59:46 ceph-master systemd[1]: Started Ceph cluster monitor daemon.
Dec 14 19:59:47 ceph-master ceph-mon[28237]: *** Caught signal (Segmentation fault) **
Dec 14 19:59:47 ceph-master ceph-mon[28237]: in thread 756a5c30 thread_name:admin_socket
Dec 14 19:59:47 ceph-master systemd[1]: ceph-mon#ceph-master.service: main process exited, code=killed, status=11/SEGV
Dec 14 19:59:47 ceph-master systemd[1]: Unit ceph-mon#ceph-master.service entered failed state.
Dec 14 19:59:47 ceph-master systemd[1]: ceph-mon#ceph-master.service holdoff time over, scheduling restart.
Dec 14 19:59:47 ceph-master systemd[1]: Stopping Ceph cluster monitor daemon...
Dec 14 19:59:47 ceph-master systemd[1]: Starting Ceph cluster monitor daemon...
Dec 14 19:59:47 ceph-master systemd[1]: Started Ceph cluster monitor daemon.
Dec 14 19:59:49 ceph-master ceph-mon[28256]: *** Caught signal (Segmentation fault) **
Dec 14 19:59:49 ceph-master ceph-mon[28256]: in thread 75654c30 thread_name:admin_socket
Dec 14 19:59:49 ceph-master ceph-mon[28256]: ceph version 10.2.5 (c461ee19ecbc0c5c330aca20f7392c9a00730367)
Dec 14 19:59:49 ceph-master ceph-mon[28256]: 1: (()+0x4b1348) [0x54fae348]
Dec 14 19:59:49 ceph-master ceph-mon[28256]: 2: (__default_sa_restorer()+0) [0x768bb480]
Dec 14 19:59:49 ceph-master ceph-mon[28256]: 3: (AdminSocket::do_accept()+0x28) [0x550ca154]
Dec 14 19:59:49 ceph-master ceph-mon[28256]: 4: (AdminSocket::entry()+0x22c) [0x550cc458]
Dec 14 19:59:49 ceph-master systemd[1]: ceph-mon#ceph-master.service: main process exited, code=killed, status=11/SEGV
Dec 14 19:59:49 ceph-master systemd[1]: Unit ceph-mon#ceph-master.service entered failed state.
Dec 14 19:59:49 ceph-master systemd[1]: ceph-mon#ceph-master.service holdoff time over, scheduling restart.
Dec 14 19:59:49 ceph-master systemd[1]: Stopping Ceph cluster monitor daemon...
Dec 14 19:59:49 ceph-master systemd[1]: Starting Ceph cluster monitor daemon...
Dec 14 19:59:49 ceph-master systemd[1]: Started Ceph cluster monitor daemon.
Dec 14 19:59:50 ceph-master ceph-mon[28271]: *** Caught signal (Segmentation fault) **
Dec 14 19:59:50 ceph-master ceph-mon[28271]: in thread 755fcc30 thread_name:admin_socket
Dec 14 19:59:50 ceph-master systemd[1]: ceph-mon#ceph-master.service: main process exited, code=killed, status=11/SEGV
Dec 14 19:59:50 ceph-master systemd[1]: Unit ceph-mon#ceph-master.service entered failed state.
Dec 14 19:59:50 ceph-master systemd[1]: ceph-mon#ceph-master.service holdoff time over, scheduling restart.
Dec 14 19:59:50 ceph-master systemd[1]: Stopping Ceph cluster monitor daemon...
Dec 14 19:59:50 ceph-master systemd[1]: Starting Ceph cluster monitor daemon...
Dec 14 19:59:50 ceph-master systemd[1]: ceph-mon#ceph-master.service start request repeated too quickly, refusing to start.
Dec 14 19:59:50 ceph-master systemd[1]: Failed to start Ceph cluster monitor daemon.
Dec 14 19:59:50 ceph-master systemd[1]: Unit ceph-mon#ceph-master.service entered failed state.
I'm looking for guidance here as I'm not sure why this doesn't work. I am using the following URLs for my apt repos:
root#ceph-master:~# cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ testing main contrib non-free rpi
root#ceph-master:~# cat /etc/apt/sources.list.d/ceph.list
deb https://download.ceph.com/debian-jewel/ jessie main
Has anyone else tried this and had similar problems? Any advice on how to proceed or work around this issue?

MongoDB on Raspberry Pi fails to load

I just installed Mongodb on my Raspberry Pi 3 using the regular sudo apt install mongodb, which gave no errors. I then checked the status:
$ sudo service mongodb status
● mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; enabled)
Active: failed (Result: exit-code) since Fri 2017-02-17 08:53:47 UTC; 5s ago
Docs: man:mongod(1)
Process: 11569 ExecStart=/usr/bin/mongod --config /etc/mongodb.conf (code=exited, status=14)
Main PID: 11569 (code=exited, status=14)
Feb 17 08:53:47 raspberrypi mongod[11569]: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6(+0x4a9a0) [0x7680e9a0]
Feb 17 08:53:47 raspberrypi mongod[11569]: Fri Feb 17 08:53:47.612 Got signal: 6 (Aborted).
Feb 17 08:53:47 raspberrypi mongod[11569]: Fri Feb 17 08:53:47.613 Backtrace:
Feb 17 08:53:47 raspberrypi mongod[11569]: 0x664160 0x16e370 0x765e2180 0x765e0f70
Feb 17 08:53:47 raspberrypi mongod[11569]: /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x1c) [0x664160]
Feb 17 08:53:47 raspberrypi mongod[11569]: /usr/bin/mongod(_ZN5mongo10abruptQuitEi+0x2a0) [0x16e370]
Feb 17 08:53:47 raspberrypi mongod[11569]: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x765e2180]
Feb 17 08:53:47 raspberrypi mongod[11569]: /lib/arm-linux-gnueabihf/libc.so.6(gsignal+0x38) [0x765e0f70]
Feb 17 08:53:47 raspberrypi systemd[1]: mongodb.service: main process exited, code=exited, status=14/n/a
Feb 17 08:53:47 raspberrypi systemd[1]: Unit mongodb.service entered failed state.
And I tried starting it with sudo service mongodb start, but in the logs (using sudo journalctl -f) I only get this:
Feb 17 08:53:58 raspberrypi sudo[11586]: pi : TTY=pts/0 ; PWD=/usr/share/elasticsearch/bin ; USER=root ; COMMAND=/usr/sbin/service mongodb start
Feb 17 08:53:58 raspberrypi sudo[11586]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Feb 17 08:53:59 raspberrypi systemd[1]: Starting An object/document-oriented database...
Feb 17 08:53:59 raspberrypi systemd[1]: Started An object/document-oriented database.
Feb 17 08:53:59 raspberrypi sudo[11586]: pam_unix(sudo:session): session closed for user root
Feb 17 08:53:59 raspberrypi mongod[11608]: Fri Feb 17 08:53:59.391 terminate() called, printing stack (if implemented for platform):
Feb 17 08:53:59 raspberrypi mongod[11608]: 0x664160 0x16d954 0x768649a0
Feb 17 08:53:59 raspberrypi mongod[11608]: /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x1c) [0x664160]
Feb 17 08:53:59 raspberrypi mongod[11608]: /usr/bin/mongod(_ZN5mongo11myterminateEv+0x54) [0x16d954]
Feb 17 08:53:59 raspberrypi mongod[11608]: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6(+0x4a9a0) [0x768649a0]
Feb 17 08:53:59 raspberrypi mongod[11608]: Fri Feb 17 08:53:59.393 Got signal: 6 (Aborted).
Feb 17 08:53:59 raspberrypi mongod[11608]: Fri Feb 17 08:53:59.394 Backtrace:
Feb 17 08:53:59 raspberrypi mongod[11608]: 0x664160 0x16e370 0x76638180 0x76636f70
Feb 17 08:53:59 raspberrypi mongod[11608]: /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x1c) [0x664160]
Feb 17 08:53:59 raspberrypi mongod[11608]: /usr/bin/mongod(_ZN5mongo10abruptQuitEi+0x2a0) [0x16e370]
Feb 17 08:53:59 raspberrypi mongod[11608]: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76638180]
Feb 17 08:53:59 raspberrypi mongod[11608]: /lib/arm-linux-gnueabihf/libc.so.6(gsignal+0x38) [0x76636f70]
Feb 17 08:53:59 raspberrypi systemd[1]: mongodb.service: main process exited, code=exited, status=14/n/a
Feb 17 08:53:59 raspberrypi systemd[1]: Unit mongodb.service entered failed state.
I don't really understand these errors. Does anybody else know what's going on?

Deploy kubernetes cluster on Azure

I tried to create kubernetes cluster(v1.2.3) on azure with coreos cluster. I followed the documentation (http://kubernetes.io/docs/getting-started-guides/coreos/azure/)
Then I cloned the repo( git clone https://github.com/kubernetes/kubernetes). And I did a minor change in file( docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml) changed the kube version from v1.1.2 to v1.2.3.
And then I created the cluster by running the file(./create-kubernetes-cluster.js), cluster is successfully created for me. But in master node API server didn't get started..
I checked the log it was showing - Cloud provider could not be initialized: unknown cloud provider "vagrant".. I could not catch why this issue was coming..
This is my Log of -> kube-apiserver.service
-- Logs begin at Sat 2016-07-23 12:41:36 UTC, end at Sat 2016-07-23 12:44:19 UTC. --
Jul 23 12:43:06 anudemon-master-00 systemd[1]: Started Kubernetes API Server.
Jul 23 12:43:06 anudemon-master-00 kube-apiserver[1964]: I0723 12:43:06.299966 1964 server.go:188] Will report 172.16.0.4 as public IP address.
Jul 23 12:43:06 anudemon-master-00 kube-apiserver[1964]: F0723 12:43:06.300057 1964 server.go:211] Cloud provider could not be initialized: unknown cloud provider "vagrant"
Jul 23 12:43:06 anudemon-master-00 systemd[1]: kube-apiserver.service: Main process exited, code=exited, status=255/n/a
Jul 23 12:43:06 anudemon-master-00 systemd[1]: kube-apiserver.service: Unit entered failed state.
Jul 23 12:43:06 anudemon-master-00 systemd[1]: kube-apiserver.service: Failed with result 'exit-code'.
Jul 23 12:43:16 anudemon-master-00 systemd[1]: kube-apiserver.service: Service hold-off time over, scheduling restart.
Jul 23 12:43:16 anudemon-master-00 systemd[1]: Stopped Kubernetes API Server.
Jul 23 12:43:16 anudemon-master-00 kube-apiserver[2015]: I0723 12:43:16.428476 2015 server.go:188] Will report 172.16.0.4 as public IP address.
Jul 23 12:43:16 anudemon-master-00 kube-apiserver[2015]: F0723 12:43:16.428534 2015 server.go:211] Cloud provider could not be initialized: unknown cloud provider "vagrant"
Jul 23 12:43:16 anudemon-master-00 systemd[1]: Started Kubernetes API Server.
Jul 23 12:43:16 anudemon-master-00 systemd[1]: kube-apiserver.service: Main process exited, code=exited, status=255/n/a
Jul 23 12:43:16 anudemon-master-00 systemd[1]: kube-apiserver.service: Unit entered failed state.
Jul 23 12:43:16 anudemon-master-00 systemd[1]: kube-apiserver.service: Failed with result 'exit-code'.
Jul 23 12:43:26 anudemon-master-00 systemd[1]: kube-apiserver.service: Service hold-off time over, scheduling restart.
Jul 23 12:43:26 anudemon-master-00 systemd[1]: Stopped Kubernetes API Server.
Jul 23 12:43:26 anudemon-master-00 systemd[1]: Started Kubernetes API Server.
Jul 23 12:43:26 anudemon-master-00 kube-apiserver[2024]: I0723 12:43:26.756551 2024 server.go:188] Will report 172.16.0.4 as public IP address.
Jul 23 12:43:26 anudemon-master-00 kube-apiserver[2024]: F0723 12:43:26.756654 2024 server.go:211] Cloud provider could not be initialized: unknown cloud provider "vagrant"
Jul 23 12:43:26 anudemon-master-00 systemd[1]: kube-apiserver.service: Main process exited, code=exited, status=255/n/a
Jul 23 12:43:26 anudemon-master-00 systemd[1]: kube-apiserver.service: Unit entered failed state.
Jul 23 12:43:26 anudemon-master-00 systemd[1]: kube-apiserver.service: Failed with result 'exit-code'.
Jul 23 12:43:36 anudemon-master-00 systemd[1]: kube-apiserver.service: Service hold-off time over, scheduling restart.
Jul 23 12:43:36 anudemon-master-00 systemd[1]: Stopped Kubernetes API Server.
Jul 23 12:43:36 anudemon-master-00 systemd[1]: Started Kubernetes API Server.
Jul 23 12:43:36 anudemon-master-00 kube-apiserver[2039]: I0723 12:43:36.872849 2039 server.go:188] Will report 172.16.0.4 as public IP address.
Have you had a look at kuberenetes-anywhere (https://github.com/kubernetes/kubernetes-anywhere)? Much work has been done there and now probably has all the right bits to deploy out your cluster with Azure specific cloud provider integrations.

Resources