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=...
HBruijn's user avatar
  • 80.3k
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 ...
Gerald Schneider's user avatar
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 ...
user24601's user avatar
  • 993
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 ...
davidsheldon's user avatar
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.
Alex's user avatar
  • 340
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 ...
Mark Wagner's user avatar
  • 18.1k
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 ...
molly's user avatar
  • 31
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. ...
yagmoth555's user avatar
  • 17.1k
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 ...
GalloCedrone's user avatar
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 ...
yahol's user avatar
  • 81
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 ...
jochem's user avatar
  • 38
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 /...
Chris Betti's user avatar
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/
Jasper Kuperus's user avatar
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 ...
Sven's user avatar
  • 99.5k
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 ...
Gerald Schneider's user avatar
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 ...
Daywalker's user avatar
  • 495
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 ...
RomanK's user avatar
  • 161
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/...
Aura's user avatar
  • 481
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
J-M's user avatar
  • 2,040
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.
Bob's user avatar
  • 11
1 vote

Is it possible to see output startup script in compute engine

grep startup-scrip /var/log/syslog
yabloki's user avatar
  • 111
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 ...
Steve Stoveld's user avatar
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 ...
o_be_one's user avatar
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....
David's user avatar
  • 626
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 ...
Jason Martin's user avatar
  • 5,093
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/...
EEAA's user avatar
  • 110k
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 "...
Nikita Kipriyanov's user avatar
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 ...
gxx's user avatar
  • 5,651

Only top scored, non community-wiki answers of a minimum length are eligible