A UNIX query

Maybe that should be eunuch’s … No, I’m only joking.

Scenario:
TextSoap has a little menu extra – except that the blasted thing won’t stay put. The preference setting to get it to stay in the menu bar always resets.

Investigation:
The 1Password site has a little troubleshooting utility. It usefully tells me that I’ve got an invalid shortname. Don’t ask me how Lion managed to suggest, and then permit me to use an invalid shortname, but that is what seems to have happened. (If anyone is interested, I have a hyphenated surname* – as far as I can gather, you are not allowed to have hyphens in shortnames, but that is what Lion allowed me to use.)
*my shortname is longer than most long names …

(Partial) Solution:
Change the name on the account (Apple has a handy set of instructions for doing this – though it feels a little scary).
Great – the TextSoap menu setting will now stick.
Not so great – loads of files still have owner 501, but the new account is 502.

Not sure if the 501/502 scenario is potentially problematic, but I’m wondering if there is any sense in trying to change the new account to 501, or the files to 502. Or, indeed, if there is a way of doing it. I suspect that there is some sort of Unix command that will chew the whole file system into small bits and spit it to all corners of the room, but if there’s something that is not too risky, perhaps I’d have a go – if it’s worth it.

All abstruse and confusing disquisitions on the inner workings of Unix will be skimmed with amazement, and perhaps even noted down for future use. I thank you in advance should anyone be so generous as to share their knowledge on the subject.

Cheers, Martin.

PS: I have admin rights on the computer – it is mine, after all.

Yeah, having the wrong user own the files in your user folder can be problematic. :slight_smile: You should run this command:

chown -R YOURNEWSHORTNAME:staff ~/*

Obviously, replacing the all-caps part with your shortname. This will just re-assign the ownership to your new account without touching the original permission flags, and it will do so for every single file in your user folder from the top to the very bottom. If you get gruff about not having permission to do this (they will be listed), then go through the list and make sure you know what the file is. If you don’t know what the file is, then just leave it be. Theoretically the user should be just fine having ownership of all files in their user folder—but I noticed on a test run that iTunes has a lot of root owned files—which is kind of dumb of Apple, but I’m not sure if those should be messed with.

I do a pretty regular

sudo chown -R ${USER} ~

iTunes resets those files (I think it is the itunes helper app but I am too lazy to figure it out) every time.

That said, I am the pointy haired boss. Execute at your own risk.

Thank you to both, that is very useful – however, the files in the user folder mostly seem to be OK (Apple does provide instructions on how to straighten them out as part of the process of renaming the account). It is files in other places that have an owner that no longer exists. In particular, almost every application has 501 as the owner (the exceptions seem to be anything downloaded from the Mac App Store, which seem to have root as the owner). There are also files in private/var/tmp, usr/local/bin, usr/local/share, Library/Application Support (not the User folder Library), /Caches, /Preference Panes, /Frameworks, /Preferences, /QuickLook and /QuickTime. At the moment things seem to be working (with one exception that I’m about to investigate) though if one does a “Get Info” in the Finder for one of the files, the panel displays the word “Fetching …” instead of the owner. Since the owner no longer exists, the system seems to be sending out its Nazgul to try and find it, and is reluctant to give up. I’d be interested in your expert opinions.

Thanks again,
Martin.

hopefully you have some time.

if you look up “find” in man (terminal --> man find) you will get more reading on a dry subject than anyone other than me would ever find interesting. Now I am going from memory because I am not at my mac so it my be a little off. In terminal sudo find / --uid 501 -exec chown ${USER} {} \;
Note the lack of -R
Note the ; not just ;
Note the empty {}

The --uid option may be wrong, but if you use “man find” then search for the string UID you should find the correct option syntax.

The only change I would make is that search operators use a single dash instead of two. So -uid 501 instead of --uid 501.

Gentlemen, I’m very grateful to you for sharing your superior knowledge. I hope I can repay at some time or another – though I’m not sure how – most of what I know might be categorised as detritus after a life of not being able to decide what to do with myself. In fact, now I come to think about it, it is a ridiculous rag-bag. Italian, Napoleonic history, social psychology, gliding and other oddities. But I digress. I think I may wait until I’ve handed in my present project (deadline 6 March) before I dive into the Terminal, but I rather look forward to it. And if I do something wrong, I will try a clean install of Lion, as by that time I will have the time to do it.

Many thanks again,
Martin.

Sounds like a modern Da Vinci. :slight_smile:

That is far too kind, but I thank you anyway. I fear that the only real point of resemblance between us is that we both have terrible trouble finishing things … Funny, though – my father’s side of the family were painters. It stopped at my generation because we turned out colour blind! But I did do a degree in history of art. I’m still not sure what I was seeing …

You have backups right? Right? So what are you so worried about?

:slight_smile:

I do indeed have backups! But I also seem to be going through a period in which I have trouble finding my mouth with a spoon – put it down to the pressures of five years of research coming to a culminating point on 6 March when I have to hand in the final version. Why do I take on big projects?

Cheers, and thanks again,
Martin.

Because you are not sane?

You have no idea how close that is to the truth! It’s one of the reasons I work in psychology these days …