119
votes
Accepted
Create a directory under /var/run at boot
There are two alternatives to have systemd create directories under /var/run / /run.
Typically the easiest is to declare a RuntimeDirectory in the unit file of your service. Example:
RuntimeDirectory=...
7
votes
How can I set environment variables when I ssh login to my Unix box by passing custom arguments?
You can enter environment variables in the PuTTY configuration under Connection -> Data.
But this works only under certain conditions. Quote from the
documentation:
The Telnet protocol provides a ...
7
votes
Create a directory under /var/run at boot
I created a service that would make the dir at start:
vim /etc/systemd/system/mydaemon-helper.service
The contents of /etc/systemd/system/mydaemon-helper.service:
[Unit]
Description=MyDaemon Helper ...
6
votes
Showing the IP in the banner before login
If you want to show the IP address in the /etc/issue, then you may be able to use \4, or \4{eth0} in the issue file. This certainly works in CentOS 7, and Ubuntu 16.04 and later. To show your IPv6 ...
6
votes
how to run a shell scripts at every login in Centos
You can add your script in ~/.bash_profile where ~ represents the homedir of the user for which running the script is intended.
4
votes
Accepted
How to allow for a slow-starting dependency service in systemd
You can add an ExecStartPost=foo to the unit file where foo is a script that checks (and rechecks) until the service is available.
Edit: you may need to increase TimeoutStartSec as well. The default ...
3
votes
GCE Ubuntu Multi-Interface Instance Route Configuration
I'm not sure this is the best solution, but I did find a way to achieve my desired result.
First, I'm of the belief that the google_compute_engine python package is performing network setup ...
3
votes
Stumped on why my Startup GPO Script isn't executing BCDEdit correctly
Make sure you have the policy for waiting for the network connection, as my guess is your computer evaluate the cached GPO before even the NIC have finished to initialize, thus fail to run the script.
...
3
votes
Is it possible to see output startup script in compute engine
Startup script output of Google Cloud Compute Engine instances is written to one of the following log files depending on the Linux distribution of the instance:
CentOS and RHEL: /var/log/messages
...
3
votes
How can I set environment variables when I ssh login to my Unix box by passing custom arguments?
For those, that cannot modify sshd config for various reasons and/or have +2000 servers (and no access to mass-configuration tools or can't/don't want to change settings for other users), here's a ...
2
votes
Accepted
How do I start Jetbrains License Server automatically on my Ubuntu system?
The anwer of @chris-betti is correct. However for DEBIAN based systems I have three additions:
ensure that runlevel 2 the license-server is also started
ensure that there is a jetbrains user
ensure ...
2
votes
How do I start Jetbrains License Server automatically on my Ubuntu system?
jochem's answer is more thorough and correct, please reference it.
First, create a jetbrains user on your server.
Second, assuming you choose to use init.d (System V), do the following:
$ touch /...
2
votes
Run unison in background on startup?
There is a built in -repeat flag, which you can give a number of seconds that unison should wait between executions. See the manual.
unison -repeat 10 -batch -owner -group /folder1/ /folder2/
2
votes
Crontab vs init.d which one to use for Startup Script?
Crontab is meant to regularly schedule jobs, not to start services at system startup. Doing this means doing it wrong.
Using rc.local is much better, but even better would be a regular systemd ...
2
votes
Unable to start a script at startup ubuntu
Scripts in /etc/init.d are not executed at startup by default. This is just the location where startup scripts are (or, by now, were) located.
After placing your script there you need to create ...
2
votes
FreeBSD: Starting PostgreSQL before other services
Take a look at:
# rcorder /etc/rc.d/* /usr/local/etc/rc.d/*
This will show you the order in which the scripts are run.
As i Understood, all scripts are started in parallel. juist theyr dependencies ...
2
votes
Accepted
Running script as user with root permissions
One way would be to create a systemd unit.
All the possible options you can find here: www.freedesktop.org/.../systemd.unit.html
but I am going to present simple example:
1.Lets create a bash script ...
2
votes
Accepted
trigger a autologon from computer startup script
Was that utility LogonExpert?
https://www.logonexpert.com/
There's a reference to it (and it was also marked as the solution) in the TechNet thread below.
https://social.technet.microsoft.com/...
1
vote
Running Powershell scripts pushed from AD GPO as admin on domain computers
Try this implementation approach:
Use GPO to run your script via Task Scheduler as SYSTEM, not a user
Give Domain Computers AD group access to a share for the script to be able to copy file from it
1
vote
System Account Access to Domain Share
C$ in path is Admin share so only Admins can access.
Instead share the Share folder as \Server\Share and set Security/Share permissions there to allow Domain Computers to access.
1
vote
Is it possible to see output startup script in compute engine
grep startup-scrip /var/log/syslog
1
vote
Unable to start a script at startup ubuntu
init scripts are deprecated as of Ubuntu 16.04. You should create a systemd service to achieve what you want.
Give it a name like myservice.service and place it in /lib/systemd/system/, then enable ...
1
vote
Unable to start a script at startup ubuntu
You can add your script to crontab with @reboot:
@reboot /path/to/my/script.sh
To complete my answer, i suggest your to use the following shebang instead of the actual one to properly load bash env ...
1
vote
Crontab vs init.d which one to use for Startup Script?
The rc.local script has the advantage that it runs at the end of the normal startup sequence. If you need most everything else started first rc.local is a better place for it. Disadvantages of rc....
1
vote
How to start java application on boot
Boot scripts executing differently at boot vs on the terminal are usually a result of the script relying on something in the environment. Have your script execute 'env' and write that to a file, and ...
1
vote
Showing the IP in the banner before login
I've done this in the past by editing /etc/issue. The following script runs on boot, which detects the current IP and then adds it to /etc/issue:
#!/bin/sh
# Save this file as /etc/network/if-up.d/...
1
vote
Clients looking for GPO login script on my personal computer instead of doing it on the DC?
Check DNS. For now it looks like it is messed up.
The as-domain ("@") A resource record should always point to nearest domain controllers, and should not point anywhere else. I.e. in AD domain "...
1
vote
Accepted
Start a script on ganeti node after instance is started or migrated
Yes. You want to use hooks for this, as outlined in the docs:
In order to allow customisation of operations, Ganeti runs scripts in sub-directories of @SYSCONFDIR@/ganeti/hooks. These sub-directories ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
startup-scripts × 126group-policy × 28
linux × 21
active-directory × 13
ubuntu × 12
windows × 10
startup × 9
debian × 8
powershell × 8
systemd × 8
init.d × 8
centos × 7
scripting × 7
apache-2.2 × 5
windows-server-2008 × 5
bash × 5
google-cloud-platform × 5
google-compute-engine × 5
ssh × 4
windows-7 × 4
rc.local × 4
rc.d × 4
mysql × 3
amazon-ec2 × 3
windows-server-2008-r2 × 3