From dawn, it is ossur to go and greet someone with a “shalom” or a “good morning” before davening Shacharis. This can be more relevant than you think (for example, in Shul, if you want to go to greet someone some distance away–[even assuming that we are talking when it is muttar to greet a person in Shul] ).
If you meet up with someone, you can say good morning; the minhag is to not say the word “shalom” in such a case. The word “shalom” has special meaning, as it is (at times) one of the Names of HaShem.
If you’ve said berachos, you can go and greet the friend with “good morning”; if you meet someone after you’ve said berachos, you can even say “shalom.”
In all cases, one can reply even with the word “shalom” to a greeting from another.
It is permitted to eat and drink in a Shul if it is for a Shul need—-e.g., a worker fixing something or a “shomer” can eat in the shul. This has come to be extended to include kiddushim and even meals in a Shul if it is perceived as a Shul need.