Why has /var/run been migrated to /run?

1

The intent is to reduce the number of tmpfs file systems. On 11.04, there are separate tmpfs file systems at /var/lock, /var/run and /dev/shm. If these directories were all under a single parent directory, then only a single tmpfs would be needed. It also provides an obvious location for further runtime state data that shouldn't persist over reboots.

Unless your application depends on canonical paths of files, your application should run without modification since the old locations will be symlinked to the new ones. The AppArmor policies are one case that does depend on the real path names, which is why it was mentioned specifically.

The following links should help explain the...

0 0
2

From the technical overview of Ubuntu 11.10 Oneiric:

Ubuntu 11.10 has migrated away from /var/run, /var/lock and /dev/shm and now uses /run, /run/lock and /run/shm instead (respectively).

I hardcode these paths in my applications, why is this change made to Oneiric? What can I do to make my applications backwards- and forward-compatible? Is there a better way other than checking first for the existence of /run, and then /var/run?

The intent is to reduce the number of tmpfs file systems. On 11.04, there are separate tmpfs file systems at /var/lock, /var/run and /dev/shm. If these directories were all under a single parent directory, then only a single tmpfs would be needed. It also provides an obvious location for further runtime state data that shouldn't persist over reboots.

Unless your application depends on canonical paths of files, your application should run without modification since the old locations will be symlinked to the new ones. The AppArmor...

0 0
3
Hi,

How do I get this working in unbuntu 11.xx?

I am the first to admit I am know Linux guru and have never played with automated start up scripts before. I am trying to get Dynimps to start with the OS, and run as a service/demon. But when I try the script below i get a (can't write to PID file) error, or the below

Code:

aaron@ubuntu:/etc/init.d$ dynamips start Cisco Router Simulation Platform (version 0.2.8-RC2-x86) Copyright (c) 2005-2007 Christophe Fillot. Build date: Jan 18 2011 19:22:29 Unable to create lock file "c7200_i0_lock". VM default: unable to create instance! C7200: unable to create instance!so the script is

Code:

#!/bin/sh # Start/stop the dynamips program as a daemon. # ### BEGIN INIT INFO # Provides: dynamips # Default-Start: 2 3 4 5 95 # Default-Stop: 0 1 6 05 # Short-Description: Cisco Hardware Emulator daemon ### END INIT INFO NAME="dynamips" ALIES="dynamips" DAEMON=/usr/bin/$NAME PIDFILE=/var/run/$ALIES.pid PORT=7200 DESC="Cisco...
0 0
4

> On Wed, Feb 06, 2013 at 10:23:06AM -0500, Mike Gilbert wrote:

>> On Wed, Feb 6, 2013 at 10:03 AM, Ian Stakenvicius

[hidden email]

> wrote:

>> > -----BEGIN PGP SIGNED MESSAGE-----

>> > Hash: SHA256

>> >

>> > On 06/02/13 09:53 AM, Markos Chandras wrote:

>> >> On 6 February 2013 14:18, Ian Stakenvicius

[hidden email]

> wrote:

>> >>>

>> >>> So, *my* systems do have /var/run -> /run , which means at some

>> >>> point the /run migration did happen and compatibility symlinks

>> >>> were created. If hwoarang's systems don't have this, there must

>> >>> be an issue somewhere.

>> >>>

>> >>

>> >> My system is a brand new ~testing installation with a

>> >> stage3-amd64-20130110.tar.bz2. I am not sure who is responsible

>> >> for creating this symlink. I see the symlink is present on that

>> >> stage3 tarball so somehow it must have been removed from my...

0 0
5

I do not think that increasing the size of /run is necessary, but in case you do need to increase it try editing your /etc/fstab file. All mountpoints and most partitions are listed there. If your /run partition is a tmpfs(which it should be, at least according to https://askubuntu.com/questions/57297/why-has-var-run-been-migrated-to-run, I would confirm before following these instructions) then you can simply change the fstab line of your /run mount to something akin to the following:

none /dev/shm tmpfs defaults,size=8G 0 0

See how the size is declared right after defaults? Try doing that. You can use megabytes as well by using M:

none /dev/shm tmpfs defaults,size=100M 0 0

Reboot the computer after this and the changes should take place.

Edit: Scratch that, looks like Ubuntu creates the run partition using files in /etc/init and /etc/init.d and not via fstab. You'd have to look through those files and find the mount command...

0 0
6

Linux

tmpfs and ramfs; shm and /run

The immediate options for RAM disks are:

ramfs is actually very thin wrapper exposing the RAM cacheing system as usable space. tmpfs, based on ramfs, adds a size limit and swappability

The main differences:

tmpfs will report an error when it hits its limit (will act like a full disk) ramfs will grow as far as it can (so will cause trashing when overused) tmpfs shows as a drive in e.g. df ramfs adds to the 'cached' figure in free/top, but so do various other things tmpfs is eligible for swap ramfs is not eligible for swap (this is sometimes can be preferable for speed guarantees)


tmpfs is the safer choice, and neither consumes RAM until you store something. To get a lot of use out of it, but avoid trashing, you could make a tmpfs disk and assign it no more than 80% of RAM (and consider other ramdisks and other ram users)

Uses

Linuxes keep various transient runtime information in ram disks,...

0 0
7

I always hate having to explain why I spent 4 hours on one line of code:

It’s not really even code, it’s just a configuration setting. I ran into the problem using Chef, the opscode nginx cookbook, and the very-new Ubuntu 14.04 LTS. Not sure if this applies to other configurations but debugging this sort of thing takes a long time with all the vagrant up-ing and all, so in case this saves someone else a few hours…

Symptoms

Whenever I’d “vagrant up” a new instance, and then run a Capistrano deploy, everytthing looked ok but would not serve web requests.

Web response was 404. Logs showed the missing content was something like “/var/www/nginx–default/index.html”, the default that’s created with a new install of nginx (though the chef run had already deleted it.) Cap tasks to manage nginx were ineffective, and SSH’ing to the server and running the raw commands manually against nginx (“nginx -s reload” etc) didn’t solve anything either. Web requests failed...
0 0
8

We use Heroku for running some of our customers applications. Deploying by a simple git push is great, but running migrations as part of the process have always been a sore point - until now.

Do it yourself

The initial approach we took was to run migrations by hand after deploy:

$ git push heroku $ heroku run rails db:migrate

This works to a degree, but has a few issues:

You have to remember to run them. There is a gap between the release of the new version and the migration having run. Deployment requires access to heroku-cli in order to run migrations. This can prove problematic when doing continous deployment from a CI server. If migrations fail your application might be left in a non-functional state until the migration is fixed.

Script it

The first issue is solvable by scripting deployments in a script - which you should do regardless. We usually have a script like bin/deploy that does the above:

#!/usr/bin/env bash set -e echo...
0 0
9

I'm using Capistrano to deploy to production for the first time, and I'm getting an error when I run

cap production deploy

The error is:

** Invoke deploy:migrate (first_time) ** Invoke deploy:set_rails_env ** Execute deploy:migrate DEBUG [048f89c6] Running /usr/bin/env if test ! -d /home/deployer_user/apps/ap_production/releases/20140209005208; then echo "Directory does not exist '/home/deployer_user/apps/ap_production/releases/20140209005208'" 1>&2; false; fi on eslope.net DEBUG [048f89c6] Command: if test ! -d /home/deployer_user/apps/ap_production/releases/20140209005208; then echo "Directory does not exist '/home/deployer_user/apps/ap_production/releases/20140209005208'" 1>&2; false; fi DEBUG [048f89c6] Finished in 0.160 seconds with exit status 0 (successful). INFO [52f75214] Running ~/.rbenv/bin/rbenv exec bundle exec rake db:migrate on eserver.net DEBUG [52f75214] Command: cd /home/deployer_user/apps/ap_production/releases/20140209005208 && (...
0 0
10

docker-compose run creates new containers

You have already noticed the problem. When you use docker-compose run, a new container is created.

When you ran the first command (makemigrations), a new container was created, makemigrations ran, and the migration files were written to the (new) container's filesystem.

When you ran the second command (migrate), another new container was created. The migration ran, but it had nothing to do. That's because the migration files were not available - they were written in a different container than this new one.

You can solve this in a couple of ways.

Using docker-compose exec

First, you can do what you already did, but use docker-compose exec instead of run.

docker-compose exec web python manage.py makemigrations docker-compose exec web python manage.py migrate

exec will use the already-running container, rather than creating new containers.

Using an entrypoint script

Another...

0 0
11

FluentMigrator’s Migrations Runners wiki page doesn’t mention any way of running migrations through code.

Why might you want to do this? Because your application is in the hands of users, or ops teams, or someone who needs to run the migrations. Or, because you want to auto-run migrations, say, on start-up.

It’s not a trivial amount of work, but it’s achievable. The core logic is in this MigrationsWrapper class I wrote:

public class MigrationsWrapper { private static Assembly migrationsAssembly = Assembly.Load("..."); private string connectionString; private Action logMethod = Console.WriteLine; public MigrationsWrapper(string connectionString, Action logMethod = null) { this.connectionString = connectionString; if (logMethod != null) { this.logMethod = logMethod; } } private MigrationRunner GetMigrator() { var announcer = new TextWriterAnnouncer(s => logMethod.Invoke(s)); var...
0 0
12
...
0 0