I am trying to run a stored procedure at startup of the SQL instance. I created the proc in the Master database and it contains linked servers. I have setup the procedure to run at startup but when the instance restarts it does not run. I have queried xp_readerrorlog and see the message that the procedure launched > Launched startup procedure 'TestProc'. When I run the procedure manually it runs fine and when I set it up in a SQL Agent Job to run at startup it runs fine. Why would I not be able to get it to run at startup? I also created a simple proc that inserts the time into a table on startup and that works fine so I know my setup is correct and it has something to do with the linked servers.
The master database is recovered before the instance is made available on the network. Therefore, your startup procedure in master is running before the linked server is available. I am not sure why your procedure didn't log any error, however. I did a little searching and found [this] summary of the startup process. :